1 | <?php |
||
23 | class Theme extends \yii\base\Theme |
||
24 | { |
||
25 | const LAYOUTS_PATH = 'layouts'; |
||
26 | |||
27 | private $_config; |
||
28 | |||
29 | /** |
||
30 | * Theme constructor with a configuration as {{\luya\theme\ThemeConfig}} object. |
||
31 | * |
||
32 | * @param ThemeConfig $config configuration for this theme. |
||
33 | */ |
||
34 | public function __construct(ThemeConfig $config) |
||
39 | |||
40 | /** |
||
41 | * Initialize the theme. |
||
42 | * |
||
43 | * @throws InvalidConfigException |
||
44 | */ |
||
45 | public function init() |
||
55 | |||
56 | /** |
||
57 | * Init the path mapping include the parent themes |
||
58 | */ |
||
59 | protected function initPathMap(ThemeConfig $themeConfig) |
||
82 | |||
83 | protected $_layout = 'theme'; |
||
84 | |||
85 | /** |
||
86 | * The name of the layout to be applied to this theme views. |
||
87 | * |
||
88 | * @return string Default `theme` |
||
89 | */ |
||
90 | public function getLayout() |
||
94 | |||
95 | /** |
||
96 | * Path to the directory that contains the theme views. |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getViewPath() |
||
104 | |||
105 | /** |
||
106 | * Path to the directory that contains the theme layouts. |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getLayoutPath() |
||
114 | |||
115 | /** |
||
116 | * Theme configuration that contains the base theme information. |
||
117 | * |
||
118 | * @return ThemeConfig |
||
119 | */ |
||
120 | public function getConfig() |
||
124 | |||
125 | /** |
||
126 | * @param ThemeConfig $themeConfig |
||
127 | * |
||
128 | * @return array |
||
129 | * @throws InvalidConfigException |
||
130 | * @throws \luya\Exception |
||
131 | */ |
||
132 | protected function getAdditionalPathMap(ThemeConfig $themeConfig) |
||
143 | } |