CakePHP - Letting the User Select the Layout -


im working on cakephp application display dvd collection. include dropdpwn menu user can select on view/colour scheme. nothing fancy, needs either change layout file css file. either work.

any tips? can't seem figure out.

regards, jon

use themes switch either layout, css, or both.

in appcontroller.php add:

$this->theme = 'fancy'; 

this default layout in app/view/themed/fancy/default.ctp. choose want customize theme. if don't have special layout file fancy theme, cakephp default app/view/layouts/default.ctp. likewise, can choose provide special stylesheet in theme go in app/view/themed/fancy/webroot/css/default.css , if not cakephp use app/view/webroot/css/default.css.

you can set user's theme selection cookie it's remembered.

you didn't version of cakephp you're using, solution similar in either 2.x or 3. above links 2.x cookbook.


Popular posts from this blog