1 | <?php |
||
34 | class ThemeManager extends \hiqdev\yii2\collection\Manager implements \yii\base\BootstrapInterface |
||
35 | { |
||
36 | /** |
||
37 | * @var array basic pathMap for all themes, will be merged with theme own pathMap |
||
38 | */ |
||
39 | public $pathMap = []; |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | protected $_itemClass = Theme::class; |
||
45 | |||
46 | /** |
||
47 | * @var string default theme name |
||
48 | */ |
||
49 | protected $_defaultTheme; |
||
50 | |||
51 | /** |
||
52 | * Sets the default theme name. |
||
53 | * |
||
54 | * @param string $theme default theme name |
||
55 | */ |
||
56 | public function setDefaultTheme($theme) |
||
60 | |||
61 | /** |
||
62 | * Returns the default theme. Returns the first of available themes by default. |
||
63 | * |
||
64 | * @return string default theme name |
||
65 | */ |
||
66 | public function getDefaultTheme() |
||
75 | |||
76 | protected $_view; |
||
77 | |||
78 | /** |
||
79 | * @return \yii\web\View |
||
80 | * @see setView |
||
81 | */ |
||
82 | public function getView() |
||
90 | |||
91 | /** |
||
92 | * You can change the View for theme manager. |
||
93 | * @param \yii\web\View $view the view object that will be used to render views or view files |
||
94 | */ |
||
95 | public function setView($view) |
||
99 | |||
100 | /** |
||
101 | * @var Theme current theme object |
||
102 | */ |
||
103 | protected $_theme; |
||
104 | |||
105 | /** |
||
106 | * Changes theme. |
||
107 | * @param string theme name |
||
108 | * @throws InvalidConfigException |
||
109 | */ |
||
110 | public function setTheme($name) |
||
117 | |||
118 | public function getTheme() |
||
130 | |||
131 | public function getSettings() |
||
135 | |||
136 | /** |
||
137 | * @return bool |
||
138 | */ |
||
139 | public static function isHomePage() |
||
145 | |||
146 | /** |
||
147 | * @var AssetBundle[] assets to be registered at bootstrap |
||
148 | */ |
||
149 | public $assets = []; |
||
150 | |||
151 | /** |
||
152 | * Register all the assets. |
||
153 | */ |
||
154 | public function registerAssets() |
||
161 | |||
162 | /** |
||
163 | * @var bool is already bootstrapped |
||
164 | */ |
||
165 | protected $_isBootstrapped = false; |
||
166 | |||
167 | /** |
||
168 | * {@inheritdoc} |
||
169 | */ |
||
170 | public function bootstrap($app) |
||
187 | |||
188 | |||
189 | /** |
||
190 | * Draws widget. |
||
191 | * @param mixed $config |
||
192 | * @return string the rendering result of the widget. |
||
193 | */ |
||
194 | public function widget($config) |
||
198 | |||
199 | /** |
||
200 | * Calls static method of class from config. |
||
201 | * Uses Yii container to get class definition. |
||
202 | * @param string $method |
||
203 | * @param mixed $config |
||
204 | * @throws InvalidConfigException |
||
205 | * @return mixed |
||
206 | */ |
||
207 | public static function callStatic($method, $config) |
||
230 | |||
231 | /** |
||
232 | * Checks if widget with given name is defined. |
||
233 | * @param mixed $name name or class |
||
234 | * @return boolean |
||
235 | */ |
||
236 | public function hasWidget($name) |
||
240 | |||
241 | /** |
||
242 | * @return SettingsStorageInterface |
||
243 | */ |
||
244 | public function getSettingsStorage() |
||
248 | |||
249 | /** |
||
250 | * @return array |
||
251 | */ |
||
252 | public function getThemeSettings() |
||
256 | } |
||
257 |