Created
April 20, 2015 10:30
-
-
Save n1215/0bc4660a84ea98274945 to your computer and use it in GitHub Desktop.
baserCMS 親テーマもどき
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('BcAppView', 'View'); | |
class AppView extends BcAppView { | |
protected $baseTheme = 'hoge'; | |
protected function _paths($plugin = null, $cached = true) { | |
//プラグインの場合はそのまま | |
if ($plugin != null) | |
{ | |
return parent::_paths($plugin, $cached); | |
} | |
//キャッシュがあれば返す | |
if ($cached === true && !empty($this->_paths)) { | |
return $this->_paths; | |
} | |
// app/webrootより一つ上の優先順位に放り込む | |
$paths = parent::_paths($plugin, false); | |
$key = array_search(WWW_ROOT, $paths); | |
$baseThemeDir = WWW_ROOT . 'theme' . DS . $this->baseTheme . DS; | |
array_splice($paths, $key, 0 , array($baseThemeDir)); | |
return $this->_paths = $paths; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment