Trouble creating a new theme

I’m setting up a web application with yii 1.1.7.

I’m trying to set up a custom theme.

For that, I created a new directory in a default web app (./yiic webapp ...), let’s call it /themes/mytheme.

I copied all the files from /themes/default into the new theme.

I added a "theme" property in /protected/config/main.php:


return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'theme'=>'mytheme', 

        ....

I made sure the "theme" directory is correct.

However, when I try to output the theme’s base URL in a view like so:


<?=Yii::app()->theme->baseUrl; ?>

it returns null. According to the themes tutorial, that means that the theme was not recognized.

I then tried copying all the files from the /protected/views directory into my new theme, but to no avail.

What else do I have to do to activate the theme?

For a quick check, I suggest you should follow the link in this thread, download one of the themes and change the config just like you did. For Zii widgets check out e.g. this wiki article.

BTW where did you find theme/default, at least it wasn’t supplied in the 1.1.4 webapp template.

/Tommy

Thank you, this worked!

I still don’t really get why - as far as I can see, I had all the files in place in my old theme already. I don’t get what triggered the system to recognize the new theme as valid.

Anyway, I’m not going to worry about that now - I’ll much rather go on exploring the framework.

Cheers!