I'm new to yii2 and looking for a little of help.
This is part of my index.php
in the site controller (basic template yii2 views/site/index.php
)
<?= $this->render('//tours/_form.php ') ?>
And I need to render the tours/_form.php
(which is a view of tours controller) in this index.php
but the error is this:
Undefined variable: model
I think the problem is in the siteController but what should I add to it?
I understand how to render views that have the same controller, but I'm assuming that this maybe is different.
Thanks in advance for your help
Edit:
This my controller action from the site controller, this is just as gii generated it
public function actionIndex()
{
return $this->render('index');
}
maybe there I have to call the tour model?