Answer the question
In order to leave comments, you need to log in
How to change controller layout in Yii?
There is a module that uses one theme. The module has a controller for which you need to connect another theme. For this I do
public function init(){
Yii::app()->theme = 'buble';
$this->layout = 'buble_main';
parent::init();
}
Answer the question
In order to leave comments, you need to log in
You don’t need to do this in the Internet, it’s enough to specify the property value in the controller class:
If it doesn’t work, then do the same in a specific action + as an option to debug if the layout has changed, it might be worth specifying the full path to it (for example //layouts/buble_main ).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question