I ran into a new issue:
I'm using a theme. This means my
/protected/views is as empty as possible. It does not even contain a
layouts folder. Everything is in
/themes/themeName/views, including the layouts folder. I've also built a module, and it looks for its layout in
/protected/modules/moduleName/views/layouts. I don't want that because it doesn't need its own layout and I want to reuse code as much as possible.
How do I make it look for the layout in the views of the theme folder in stead of within the module views?
The least code duplication I've managed to achieve so far is by creating the column1.php (and others) file and refer it to the themed main.php like this:
<?php $this->beginContent('webroot.themes.'.Yii::app()->theme->name.'.views.layouts.main'); ?>
This variable declaration doesn't seem to work in a controller:
public $layout='webroot.themes.'.Yii::app()->theme->name.'.views.layouts.column1';
This variable declaration would work in a controller, but causes hard-coding the theme which is bad:
public $layout='webroot.themes.themeName.views.layouts.column1';
Would appreciate some advice on this one. Thanks!