Yii3: Error Undefined variable $field in view file

Hello All,

I’m trying to create a new module in Yii3 using Yii App.

I got error:

PHP Warning — Yiisoft\ErrorHandler\Exception\ErrorException
Undefined variable $field
Yiisoft\ErrorHandler\Exception\ErrorException: Undefined variable $field in C:\xampp\htdocs\yii3\src\Login\views\login\form.php:38
Stack trace:
#0 C:\xampp\htdocs\yii3\src\Login\views\login\form.php(38): Yiisoft\ErrorHandler\ErrorHandler::Yiisoft\ErrorHandler\{closure}(2, 'Undefined varia...', 'C:\\xampp\\htdocs...', 38)
#1 C:\xampp\htdocs\yii3\vendor\yiisoft\view\src\PhpTemplateRenderer.php(28): require('C:\\xampp\\htdocs...')

Seems you don’t have a variable defined. I guess that’s:

  1. demo/ContentViewInjection.php at 6822a1f2e0997a19e9b06ea2d3dac28aed632568 · yiisoft/demo · GitHub
  2. demo/params.php at master · yiisoft/demo · GitHub

Check if the same is done in your app.

Yes, I’m confused looking for it :slight_smile:
Thanks samdark, It’s solved now