I have broken up my application into sections such as public, private, admin etc… and have controllers for each, i also want to have a different theme for each section by having themes/public, themes/private, themes/admin.
Obviously I can activate each theme via protected/config/main.php with the following code
‘theme’ => ‘public/public_theme_1.0.0’
How do i switch between themes on a controller basis so as the user navigates to each section the controller updates the theme?
class AdminController extends CController
public function init()
Yii::app()->themeManager->basePath .= '/admin';
Yii::app()->themeManager->baseUrl .= '/admin';
Yii::app()->theme = 'admin_theme_1.0.0'; // You can set it there or in config or somewhere else before calling render() method.