Egorka
7 years ago
8 changed files with 48 additions and 30 deletions
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* Created by Error202 |
||||||
|
* Date: 23.07.2018 |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace frontend\components; |
||||||
|
|
||||||
|
|
||||||
|
use yii\base\Theme; |
||||||
|
use yii\web\Controller; |
||||||
|
use Yii; |
||||||
|
|
||||||
|
class FrontendController extends Controller |
||||||
|
{ |
||||||
|
public function init() { |
||||||
|
parent::init(); |
||||||
|
|
||||||
|
$theme = isset(Yii::$app->params['settings']['design']['theme']) ? Yii::$app->params['settings']['design']['theme'] : 'start'; |
||||||
|
|
||||||
|
Yii::$app->view->theme = new Theme([ |
||||||
|
'basePath' => '@webroot/themes/' . $theme, |
||||||
|
'baseUrl' => '@web/themes/' . $theme, |
||||||
|
'pathMap' => [ |
||||||
|
'@common/modules' => '@webroot/themes/' . $theme . '/modules', |
||||||
|
'@frontend/views' => '@webroot/themes/' . $theme, |
||||||
|
'@frontend/widgets' => '@webroot/themes/' . $theme . '/widgets', |
||||||
|
], |
||||||
|
|
||||||
|
]); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue