Skip to content

Commit e081e5e

Browse files
dev
1 parent e1b79c6 commit e081e5e

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/ThemeComponent.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
class ThemeComponent extends Theme
1616
{
1717
public $name = "Theme name";
18+
19+
public $themeConfig = [];
1820
}

src/ViewComponent.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
class ViewComponent extends View
1818
{
19+
public $isEnabled = true;
1920
/**
2021
* @var array Availables app themes
2122
*/
@@ -37,6 +38,11 @@ class ViewComponent extends View
3738

3839
public function init()
3940
{
41+
if (!$this->isEnabled)
42+
{
43+
return parent::init();
44+
}
45+
4046
if (!$this->themes)
4147
{
4248
return parent::init();
@@ -52,12 +58,16 @@ public function init()
5258
return parent::init();
5359
}
5460

55-
if (!isset($themeData['class']))
61+
/*if (!isset($themeData['class']))
5662
{
5763
$themeData['class'] = 'skeeks\cms\view\ThemeComponent';
64+
}*/
65+
66+
if (!isset($themeData['themeConfig'])) {
67+
return parent::init();
5868
}
5969

60-
$this->theme = $themeData;
70+
$this->theme = $themeData['themeConfig'];
6171

6272
return parent::init();
6373
}

0 commit comments

Comments
 (0)