theme` and `$this->viewClass = 'Theme'` * in your Controller to use the ThemeView. * * Example of theme path with `$this->theme = 'super_hot';` Would be `app/View/Themed/SuperHot/Posts` * * @package Cake.View */ class ThemeView extends View { /** * Constructor for ThemeView sets $this->theme. * * @param Controller $controller Controller object to be rendered. */ public function __construct($controller) { parent::__construct($controller); if ($controller) { $this->theme = $controller->theme; } } /** * Return all possible paths to find view files in order * * @param string $plugin The name of the plugin views are being found for. * @param boolean $cached Set to true to force dir scan. * @return array paths * @todo Make theme path building respect $cached parameter. */ protected function _paths($plugin = null, $cached = true) { $paths = parent::_paths($plugin, $cached); $themePaths = array(); if (!empty($this->theme)) { $count = count($paths); for ($i = 0; $i < $count; $i++) { if (strpos($paths[$i], DS . 'Plugin' . DS) === false && strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) { if ($plugin) { $themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS; } $themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS; } } $paths = array_merge($themePaths, $paths); } return $paths; } }