@@ -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 |
@@ -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() |
@@ -146,6 +146,9 @@ |
||
146 | 146 | return $themeDefinitions; |
147 | 147 | } |
148 | 148 | |
149 | + /** |
|
150 | + * @param string $basePath |
|
151 | + */ |
|
149 | 152 | public function getThemeByBasePath($basePath) |
150 | 153 | { |
151 | 154 | $themes = $this->getThemes(); |
@@ -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 { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | if (file_exists(Yii::getAlias('@app/themes'))) { |
136 | 136 | foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) { |
137 | - $themeDefinitions[] = "@app/themes/" . basename($dirPath); |
|
137 | + $themeDefinitions[] = "@app/themes/".basename($dirPath); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | $this->_themes[$themeConfig->getBasePath()] = $themeConfig; |
174 | 174 | |
175 | - Yii::setAlias('@' . basename($themeConfig->getBasePath()) . 'Theme', $themeConfig->getBasePath()); |
|
175 | + Yii::setAlias('@'.basename($themeConfig->getBasePath()).'Theme', $themeConfig->getBasePath()); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |