Theme As Module

Greetings, I have the next question.

I am currently developing a base theme for use by all developments in the place where I work. The point is that the theme comes with some extensions, documentation, and application settings, the problem arises when we implement this in all developments hat we make with Yii. When the theme is implemented, we have to edit the main.php file to use it.

What I want to know is if there is any way to have this theme as a module, so we only have to import the module in the protected/config/main.php general config, and in the protected/modules/theme/config/main.php (config from module) add the aditional preferences to use the theme.

Currently, to use the theme, I declare in the protected/config/main.php file:

'theme' => 'item',

But this theme is in themes/theme, so, I could have this assignment in the configuration of the module, so when I import the module in the protected/config/main.php, the preferences in protected/modules/theme/config/main.php will overwrite the general preferences, but how I tell Yii that the theme to be used will be in protected/modules/theme

Thanks :)

I save my config params and settings in a file (or you can use a db). I also have a form to edit the settings in my admin panel. My themes are just a dropdown list that reads the file names under themes.

I put all my site info in params too i.e. site name, copyright, descriptions etc and i use them at the top of all my theme main files so i don’t have to edit every theme and i can use the same themes for multiple sites without changing head info.


	<meta charset="utf-8">

	<title><?php echo Yii::app()->name; ?> - <?php echo Yii::app()->params['tagline']; ?> | <?php echo Yii::app()->params['phone']; ?></title>


	if (isset($this->pageTitle))


	echo $this->pageTitle.' | '.Yii::app()->params['company'].' | '.Yii::app()->params['tagline'];


	else {

	echo Yii::app()->params['company'].' | '.Yii::app()->params['tagline'].' | '.Yii::app()->params['phone'];

	}; ?>


	<meta name="description" content="<?php if (!empty($this->pageDescription))


	echo $this->pageDescription;



	echo Yii::app()->name.' '.Yii::app()->params['tagline'].' of '.Yii::app()->params['city'].' '.Yii::app()->params['state'];


	" />

	<meta name="owner" content="<?php echo Yii::app()->params['company']; ?>">

	<meta name="author" content="<?php echo Yii::app()->params['company']; ?>">

	<meta name="copyright" content="Copyright <?php echo date('Y') .' '. Yii::app()->name.'&trade; v'. Yii::app()->params['version'].' by '.Yii::app()->params['company']; ?>">

	<meta name="keywords" content="


	$keyword_tags = Tags::model()->findAll();

	foreach ($keyword_tags as $keyword_tags){

	echo $keyword_tags->name.', ';


	echo Yii::app()->name.', '.Yii::app()->params['tagline'].', '.Yii::app()->params['city'].', '.Yii::app()->params['state'];?>


	<title><?php echo isset($this->pageTitle) ? $this->pageTitle.' '.Yii::app()->name : Yii::app()->name.' - '.Yii::app()->params['tagline']; ?> </title>


my params are something like this






        	// this is used in contact page



        	'company'=>'Company Name',

        	'tagline'=>'Company Tag Line',






        	'owner'=>CHtml::link('mycompay&trade;', '', array('target'=>'_blank')),
















I have a file that i can edit in my admin panel via form fields to update the info.