How to get current theme name or theme working in cakephp
Making theme set and available by setting theme related properties in controller
Prior to cakephp 2.0
class UserController extends AppController {
var $view = 'Theme'; //tells controller to use "ThemeView" class instead of the default "View" class
var $theme = 'WhiteFeather'; //name of the theme folder which is supposed to be placed at views/themed/
}
Cakephp 2.0
class UserController extends AppController {
public $viewClass = 'Theme'; //tells controller to use "ThemeView" class instead of the default "View" class
public $theme = 'WhiteFeather'; //name of the theme folder which is supposed to be placed at View/Themed
}
Theme can be changed within a controller function or in beforeFilter/beforeRender by overriding the theme property:
$this->theme = 'BlackFeather';
You may want to know more about themes, here:
CakePHP 1.3 link http://book.cakephp.org/view/1093/Themes
Cakephp 2.0 documentation http://book.cakephp.org/2.0/en/views/themes.html
Possibly Related posts:
- Croogo – A free open source CakePHP powered CMS for PHP
Croogo is a free web based CMS (Content Management System) for PHP built on the top of CakePHP MVC framework. It was first released on... - Passed arguments routing and custom ajax pagination url in cakephp
While working in my recent “charity project” i had to list all charities found in a particular region or state. I created a regions_controller and... - A note on difference between app:import and loadmodel in CakePHP
Posting for, someone searched for terms “cakephp what is the difference between app:import model and loadmodel” and “cakephp what is the difference between app:import and... - Template drop down list missing in edit page in wordpress
Last night i installed a new theme to this blog of mine and after setting basic things up when i went to edit my archives... - A tip on CakePHP find list with related model conditions
You will need to add recursive=>(value) to the $params when you need to get a ‘list’ of table items using related model conditions. Referring to...
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.






Nice tips, Thanks.
Anyways what things in CakePHP 2.0 you like the most?
Hi, Thanks for this post.