Page Template


i am creating a website where I need to have more then one page template so that admin can select a page template while creating a page ( similar to feature present in wordpress)

please let me know whether it is possible in YII and if possible how to achieve it.

thank you in advance


Of course it is possible

Just change a couple lines in the admin controller your layout doing something like

$this->layout='//layouts/purple';//this will point to application.views.layouts.purple


$this->layout='/layouts/purple';//this will point to module.layouts.purple

and that is it, and you can do what you said, get the user’s config and set accordly with user’s selection

thanks a lot,

I will try to implement and let you know the result