theme` and `$this->view = 'Theme'` * in your Controller to use the ThemeView. * * Example of theme path with `$this->theme = 'super_hot';` Would be `app/views/themed/super_hot/posts` * * @package cake * @subpackage cake.cake.libs.view */ class ThemeView extends View { /** * Constructor for ThemeView sets $this->theme. * * @param Controller $controller */ function __construct(&$controller, $register = true) { parent::__construct($controller, $register); $this->theme =& $controller->theme; } /** * Return all possible paths to find view files in order * * @param string $plugin * @param boolean $cached Set to true to force dir scan. * @return array paths * @access protected * @todo Make theme path building respect $cached parameter. */ 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 . 'plugins' . DS) === false && strpos($paths[$i], DS . 'libs' . DS . 'view') === false) { if ($plugin) { $themePaths[] = $paths[$i] . 'themed'. DS . $this->theme . DS . 'plugins' . DS . $plugin . DS; } $themePaths[] = $paths[$i] . 'themed'. DS . $this->theme . DS; } } $paths = array_merge($themePaths, $paths); } $this->__paths = $paths; return $this->__paths; } } ?>