@@ -86,6 +86,6 @@ |
||
86 | 86 | |
87 | 87 | public function getViewPath(): string |
88 | 88 | { |
89 | - return $this->getBasePath() . '/views'; |
|
89 | + return $this->getBasePath().'/views'; |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -149,6 +149,9 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | |
152 | + /** |
|
153 | + * @param string $basePath |
|
154 | + */ |
|
152 | 155 | public function getThemeByBasePath($basePath) |
153 | 156 | { |
154 | 157 | $themes = $this->getThemes(); |
@@ -169,7 +172,7 @@ discard block |
||
169 | 172 | } |
170 | 173 | |
171 | 174 | /** |
172 | - * @param Theme|string $theme |
|
175 | + * @param Theme $theme |
|
173 | 176 | */ |
174 | 177 | public function setActiveTheme($theme) |
175 | 178 | { |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | $dir = Yii::getAlias($basePath); |
49 | 49 | |
50 | 50 | if (!is_dir($dir) || !is_readable($dir)) { |
51 | - throw new Exception('Theme directory not exists or readable: ' . $dir); |
|
51 | + throw new Exception('Theme directory not exists or readable: '.$dir); |
|
52 | 52 | } |
53 | 53 | |
54 | - $themeFile = $dir . '/theme.json'; |
|
54 | + $themeFile = $dir.'/theme.json'; |
|
55 | 55 | if (file_exists($themeFile)) { |
56 | 56 | $config = Json::decode(file_get_contents($themeFile)) ?: []; |
57 | 57 | } else { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | foreach ($themeDefinitions as $themeDefinition) { |
120 | 120 | $themeConfig = static::loadThemeConfig($themeDefinition); |
121 | 121 | $this->_themes[$themeDefinition] = $themeConfig; |
122 | - Yii::setAlias('@' . basename($themeConfig->getBasePath()), $themeConfig->getBasePath()); |
|
122 | + Yii::setAlias('@'.basename($themeConfig->getBasePath()), $themeConfig->getBasePath()); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | return $this->_themes; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | if (file_exists(Yii::getAlias('@app/themes'))) { |
138 | 138 | foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) { |
139 | - $themeDefinitions[] = "@app/themes/" . basename($dirPath); |
|
139 | + $themeDefinitions[] = "@app/themes/".basename($dirPath); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | $pos = strpos($viewPath, '/'); |
65 | - $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views'); |
|
65 | + $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views'); |
|
66 | 66 | $this->pathMap[$rootPath] = $pathMap; |
67 | 67 | } |
68 | 68 | |
@@ -80,17 +80,17 @@ discard block |
||
80 | 80 | |
81 | 81 | public function getLayoutPath(): string |
82 | 82 | { |
83 | - return $this->viewPath . '/layouts'; |
|
83 | + return $this->viewPath.'/layouts'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function getLayoutFile() |
87 | 87 | { |
88 | - return $this->layoutPath . '/' . $this->layout . '.php'; |
|
88 | + return $this->layoutPath.'/'.$this->layout.'.php'; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | public function getResourcePath() |
92 | 92 | { |
93 | - return $this->basePath . '/resources'; |
|
93 | + return $this->basePath.'/resources'; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | public function getConfig() |