Reputation: 31
I am beginner in yii2, there are two page in my project, one for public user and one for registered users. Now how can i have two layouts in layouts folder and how can i to render in controller?
Upvotes: 1
Views: 1549
Reputation: 133400
You can create all the layout you want in view/layout ..
You can set the layout in controller .
public function actionEvent()
{
$this->layout = 'you_layout';
return $this->render('event' ,['dataProvider' => $dataProvider]);
}
Upvotes: 1