My Solution
I added
use app\models\LoginForm
to main.php and then made a new model variable $model and passed it into the view.
<?php
$model = new LoginForm();
echo Accordion::widget([
'items' => [
[
'header' => 'Subscriber Login',
'content' => yii\base\View::render('/site/login',['model'=>$model]),
],
]
]);
?>
This is my first venture into 2.0 from 1.1.
I am trying to render the login form in an accordion widget. I have tried
<?php
echo Accordion::widget([
'items' => [
[
'header' => 'Subscriber Login',
'content' => yii\base\View::render('/site/login',['model'=>'LoginForm']),
],
]
]);
?>
<?php
$model = new LoginForm();
echo Accordion::widget([
'items' => [
[
'header' => 'Subscriber Login',
'content' => yii\base\View::render('/site/login',['model'=>$model]),
],
]
]);
?>
in main.php and receive a Call to a member function getAttributeLabel() on a non-object error.
How do I pass the model?