I am trying to get work layout in a module. So I created a layout in view folder of module called 'adminLayout'
Assuming a layout in AdminModule.php
in init() method.
So now it looks like this:
public function init()
{
$this->layoutPath = Yii::getPathOfAlias('application.modules.admin.views.layouts');
$this->layout = 'adminLayout';
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
$this->setImport(array(
'admin.models.*',
'admin.components.*',
));
}
But for some reason layout didn't apply to module. I tried to add "public $layout" to controller and it works.
Can't figure out what problem is.
Also I tried to add layout settings to main.php
in config folder, but still no action. Will be grateful if someone could help.