Answer the question
In order to leave comments, you need to log in
Where does it set the layout in a basic YII2 application?
I understand Yii2, I downloaded the basic application. Views have layout main.php which is shown on all pages. Where is it asked? Neither in configs nor in controllers is there anything like layout=main
Answer the question
In order to leave comments, you need to log in
It can be overridden in many places, for example in an action:
Here are the docs on the topic: www.yiiframework.com/doc-2.0/guide-structure-views...
main comes by default, you can set your own by passing $this->layout = 'yourLayout';
main.php is the default layer used by the application if it is not set in the config or controller. Respectively set in Yii components
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question