How to create new layout?

Hello Team,

I have setup yii2.0_advanced_app. I am working on backned adminsitration. As we know there is only one layout main.php on this path @backend/views/layout/main.php. This is common layout for all three pages logout.php, index.php and login.php. I want to have diffrent layout for login.php and index.php. How can i get this? kindly, let me know.

You can set a different layout in each controller action:

http://www.yiiframework.com/doc-2.0/yii-base-controller.html#$layout-detail

Hey Manpreet,

I seriously suggest you to read the WHOLE guide:

http://www.yiiframework.com/doc-2.0/guide-README.html

Also always leave a tab to the guide open and make use of the search function.

It will propably answer a lot of your questions regarding many basic things much faster than the forum. :)

Regarding Layouts:

http://www.yiiframework.com/doc-2.0/guide-structure-views.html#layouts

Regards