Theming My Module


I beginn to learn Yii and I have a question about theme for a module:

I have created a theme under /webroot/themes/classic.

I have put in my /protected/config/main.php the line :


Everything works fine except for the modules that are not rendered with the appropiate theme.

So, according to :

I copied the file /webroot/themes/classic/views/layout/main.php under /webroot/themes/classic/views/mymodule/layout/main.php and everything works like a charm.

But now I have two main.php layout file to maintain and I have a lot of other modules to apply this theme on.

How can I avoid to duplicate this main.php file ? Am I missing something here ?

Thanks for your help

ok it seems that I made a mistake in my column2.php. I now have changed :

<?php $this->beginContent('/layouts/main'); ?>


<?php $this->beginContent('//layouts/main'); ?>

and my theme is applied to all my modules.

Sorry for that.