简体   繁体   中英

How can I switch between the different theme while moving from different actions of same controller or different controller in YII

I have just started YII one week back. I have made a theme in that is

\themes\yog

it is very small project, just 4-5 forms, those are mostly fro the admin. so what i want now it suppose i am using the

site/login

route, I want to render it via YII's default views . ie

\protected\views

I want to run the default views for only some actions, like login, or adding news, event and other admin related tasks. But other actions should render the views from my new theme.

Thanks.

In that SiteController set Yii::app()->theme to a non existing theme, and it should fall back to use the views from the protected/layouts file.

If you want to specify different layout files read this: Yii: Render action using different layout than controller's layout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM