1 | <?php |
||
20 | class Theme extends \yii\base\Theme implements \hiqdev\yii2\collection\ItemWithNameInterface |
||
21 | { |
||
22 | use GetManagerTrait; |
||
23 | |||
24 | /** |
||
25 | * @var string theme name |
||
26 | */ |
||
27 | public $name; |
||
28 | |||
29 | /** |
||
30 | * @var string theme label |
||
31 | */ |
||
32 | public $label; |
||
33 | |||
34 | /** |
||
35 | * @var array assets to be registered for this theme |
||
36 | */ |
||
37 | public $assets = []; |
||
38 | |||
39 | private $_view; |
||
40 | |||
41 | /** |
||
42 | * Returns the view object that can be used to render views or view files. |
||
43 | * The [[render()]] and [[renderFile()]] methods will use |
||
44 | * this view object to implement the actual view rendering. |
||
45 | * If not set, it will default to the "view" application component. |
||
46 | * |
||
47 | * @return \yii\web\View the view object that can be used to render views or view files |
||
48 | */ |
||
49 | public function getView() |
||
57 | |||
58 | /** |
||
59 | * Sets the view object to be used. |
||
60 | * |
||
61 | * @param View $view the view object that can be used to render views or view files |
||
62 | */ |
||
63 | public function setView($view) |
||
67 | |||
68 | public $pathMap = []; |
||
69 | |||
70 | /** |
||
71 | * Getter for pathMap. |
||
72 | */ |
||
73 | public function init() |
||
87 | |||
88 | public function compilePathMap($map) |
||
112 | |||
113 | public function substituteVars($vars) |
||
137 | |||
138 | public function isVar($name) |
||
142 | |||
143 | public function calcExp($exp, $vars) |
||
144 | { |
||
145 | $pos = strpos($exp, '/'); |
||
146 | if ($pos === false) { |
||
147 | return $vars[$exp]; |
||
148 | } |
||
149 | list($name, $suffix) = explode('/', $exp, 2); |
||
150 | |||
151 | return array_map(function ($a) use ($suffix) { |
||
152 | return "$a/$suffix"; |
||
153 | }, $vars[$name]); |
||
154 | } |
||
155 | |||
156 | public function buildThemedViewPaths() |
||
162 | |||
163 | public function findParentPaths() |
||
177 | |||
178 | protected $_reflection; |
||
179 | |||
180 | public function getReflection() |
||
188 | |||
189 | private $_settings; |
||
190 | |||
191 | /** |
||
192 | * @param string $settings theme settings model class name or config |
||
193 | */ |
||
194 | public function setSettings($settings) |
||
198 | |||
199 | public function getSettings() |
||
212 | |||
213 | public static function calcSettingsClass($class) |
||
217 | |||
218 | public static function findSettingsClass($class) |
||
224 | |||
225 | public function getDetailedTheme() |
||
232 | } |
||
233 |