Answer the question
In order to leave comments, you need to log in
How to change default yii2 template?
How to change default yii2 template?
I installed Twig , but the frame pulls main.php all the time, but I would like main.twig.
So far, in the Controller class (from which all controllers are inherited), I have added a field
public $layout = 'main.twig';
I don’t know how correct this is and whether another person can find it if they dig into my code.
I know that it would be more correct to override the layout property in a specific controller, but I need to change main for everyone and I don’t want to prescribe this in every controller.
Answer the question
In order to leave comments, you need to log in
You can set the layer to be common to all views of the application in the configuration of the application itself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question