How can i change the layout from the view file, in Yii 1.x the following variable did the trick;
$this->layout = ‘newLayout’;
But in Yii2 this doesn’t work. I know I can set this from the controller action, but i am using static pages that are using the same render action, so i need to do this on view level.
$this->context->layout = 'newLayout';
This work in the controller action in Yii2
My actionLogin :
public function actionLogin()
$this->layout = 'login'; // This change de layout use in actionLogin only...