Using Multi-Themes on Controller

Hi Everyone,

I’ve started a project, now I want to use another theme on my AdminController (Not Layout)!

It’s my Back-End, if can’t do it I’ll make by module @@ (Quite hard for me)

Ex: I have 2 themes: display and admin

I’ve configed the config/main.php that using display theme

And now when I connect to AdminController It’ll use admin theme…

Tks!

you could try this:


 //   in your AdminController  add a method:

 public function beforeAction($action)

{

    Yii::app()->theme = 'admin';

    return true;

}

i never do this ,so this just a tip . you can refer here setTheme and here theming

if above has effecting , you may consider the following if not just ignore my thoughts :


 

//   in your AdminController  add a method:


 private $oldTheme ;

 public function beforeAction($action)

{

    $this->oldThem =     Yii::app()->theme;

    Yii::app()->theme = 'admin';

    return true;

}

protected function afterAction($action){


    Yii::app()->theme = $this->oldTheme;

}




just my thought . if you use the module as your backend app; try : beforeControllerAction afterControllerAction in your AdminModule ;

This method?

http://www.yiiframework.com/forum/index.php/topic/26908-controller-themes/