how to change the default theme of Yii application with my own theme?

I am new for this Yii framework , and working on a project which is just same to I also purchased the Yii application of the same

my question is that, how to change the default theme of this project with my own designed theme or layout ??

Please help me to rid out of this problem …

Hey, Its simple.

Just create a folder name themes on the root of application, inside it create a folder with your theme name and copy the /views in it.

Now you can change the main.php of your theme folder and column1 and column2.php files in the layouts folder.

Last is to update your theme in the config/main.php

you may also have look to the following

must read is recommended

In your root directory, create a folder themes/your_theme_name

Inside your themes folder is where all your views should go,









In your config/main.php, add


Thanks to response …

But again i have a doubt, the application which i have purchased has own css and js,etc.

my question is that, how to apply all the functionality of my application on my theme(which i added manually) ?

can anybody help me out, how to link the social media icon ?

Hello everyone…

Thanks to all for response.

Now I have again a problem, can I use two different top header(Navigation), in a single layout?

means, at my home page, there is only one menu item which is Login, and after successful login, my navition will be converted into a multiple items, like, about, offers, get in touch, etc…

how to resolve this problem?

Please do reply


Its quite easy.

You can check status of user in layout file using "Yii::app()->user->isGuest" function . If its return true then include header file with single navigation and in else part you can include other file.


Thanks Anamika…

Thanks Anamika, I have solved that problem…

thanks a lot…

I have one more problem, could you help me ?

I purchased an Yii application, which is running on local host well, but when I am uploading this application on server, only home page(first page) is working, rest of the links, login popup, etc are not working. Page not founds error is displaying…

please tell me how to solve this problem.

Hello arshad,

Its really good, that your problem is solved.:) I hope rewrite mode is off on your server, please check.



hello Anamika …

The server on which I am uploading the my Yii application, is my company’s server like http://www.mycompany

but on the same server i have uploaded so many web applications.

so please tell me how to resolve this problem.

thanks for reply …


Have you setup any Yii application before on this server?

If no please setup a demo Yii application and test with that, that’s links are working or not.



Please create a .htaccess file on root path and place this code there.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

otherwise forward it to index.php

RewriteRule . index.php

Then check


It’s an Url issue first check your urls and change them as per your server requirement and than create a file in your project root as .htaccess with following content.

RewriteEngine on

If a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Otherwise forward it to index.php

RewriteRule . index.php