Hello,
I’ve read 5-6 same topics, but I still can’t find the solution…
I have an empty project with admin module and I want to use modules/admin/views/layout/main.php for admin layout but still can’t get it work.
I tried with $this->layout in AdminModule.php and all of the stuff from related topics.
Please, can someone tell me (or better, give me an example with very simple app/module) how this should work.
I am using the latest Yii version from download page.
Thank you.
tri
(tri - Tommy Riboe)
2
According to the class reference, I think you should try setting layoutPath to ‘protected/modules/admin/views/layouts/main.php’
(untested though)
/Tommy
Finaly… this solution works for me:
1. In AdminModule.php i have:
$this->layout = ‘/layouts/main’;
in init() function.
2. Then in column1.php and column2.php (from your module layouts dir) change:
‘//layouts/main’
to
‘/layouts/main’
3. And the last step:
In DefaultController.php (or else module controller), overwrite Controller $layout with this:
public $layout = ‘/layouts/column2’;
Everyone is trying to set only layout in AdminModule.php and that’s why it didn’t work.