I want to set up at least two different themes for guest and for admin user. It also would be handy to have the option to set up different theme for different type of user. For example premium user would see things differently to guest and to admin.
When I try following in /config/main.php:
'theme'=>(Yii::app()->user->isGuest)?'bluebox':'classic',
it always evaluates as false. I guess engine is not initialized yet. Is there any way how to achieve this?
You can't configure multiple themes in config.php file, you can do this in your controller.
public function init()
{
if(Yii::app()->user->isGuest)
Yii::app()->theme = 'bluebox';
else
Yii::app()->theme = 'classic';
parent::init();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With