1 | <?php |
||
35 | class ThemeManager extends \hiqdev\yii2\collection\Manager implements \yii\base\BootstrapInterface |
||
36 | { |
||
37 | /** |
||
38 | * @var array basic pathMap for all themes, will be merged with theme own pathMap. |
||
39 | */ |
||
40 | public $pathMap = []; |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | protected $_itemClass = Theme::class; |
||
46 | |||
47 | /** |
||
48 | * @var string default theme name |
||
49 | */ |
||
50 | protected $_defaultTheme; |
||
51 | |||
52 | /** |
||
53 | * Sets the default theme name. |
||
54 | * |
||
55 | * @param string $theme default theme name |
||
56 | */ |
||
57 | public function setDefaultTheme($theme) |
||
61 | |||
62 | /** |
||
63 | * Returns the default theme. Returns the first of available themes by default. |
||
64 | * |
||
65 | * @return string default theme name |
||
66 | */ |
||
67 | public function getDefaultTheme() |
||
76 | |||
77 | protected $_view; |
||
78 | |||
79 | /** |
||
80 | * @return \yii\web\View |
||
81 | * @see setView |
||
82 | */ |
||
83 | public function getView() |
||
91 | |||
92 | /** |
||
93 | * You can change the View for theme manager. |
||
94 | * @param \yii\web\View $view the view object that will be used to render views or view files. |
||
95 | */ |
||
96 | public function setView($view) |
||
100 | |||
101 | /** |
||
102 | * @var Theme current theme object |
||
103 | */ |
||
104 | protected $_theme; |
||
105 | |||
106 | /** |
||
107 | * Changes theme. |
||
108 | * @param string theme name |
||
109 | * @throws InvalidConfigException |
||
110 | */ |
||
111 | public function setTheme($name) |
||
118 | |||
119 | public function getTheme() |
||
131 | |||
132 | public function getSettings() |
||
136 | |||
137 | /** |
||
138 | * @return bool |
||
139 | */ |
||
140 | public static function isHomePage() |
||
146 | |||
147 | /** |
||
148 | * @var AssetBundle[] assets to be registered at bootstrap. |
||
149 | */ |
||
150 | public $assets = []; |
||
151 | |||
152 | /** |
||
153 | * Register all the assets. |
||
154 | */ |
||
155 | public function registerAssets() |
||
162 | |||
163 | /** |
||
164 | * @var bool is already bootstrapped |
||
165 | */ |
||
166 | protected $_isBootstrapped = false; |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function bootstrap($app) |
||
188 | |||
189 | public $widgets = []; |
||
190 | |||
191 | /** |
||
192 | * Draws widget. |
||
193 | * @param mixed $config |
||
194 | * @throws InvalidConfigException |
||
195 | * @return void |
||
196 | */ |
||
197 | public function widget($config) |
||
217 | |||
218 | /** |
||
219 | * Checks if widget with given name is defined. |
||
220 | * @param mixed $name name or class |
||
221 | * @return boolean |
||
222 | */ |
||
223 | public function hasWidget($name) |
||
227 | |||
228 | /** |
||
229 | * @return SettingsStorageInterface |
||
230 | */ |
||
231 | public function getSettingsStorage() |
||
235 | |||
236 | /** |
||
237 | * @return array |
||
238 | */ |
||
239 | public function getThemeSettings() |
||
243 | } |
||
244 |