diff --git a/src/UnifyTheme.php b/src/UnifyTheme.php index 6797a98..79077e1 100644 --- a/src/UnifyTheme.php +++ b/src/UnifyTheme.php @@ -16,6 +16,7 @@ use yii\base\Theme; use yii\helpers\ArrayHelper; use yii\helpers\FileHelper; +use yii\web\View; /** * @property string $favicon путь к фавиконке @@ -177,11 +178,15 @@ static public function initBeforeRender() } - \Yii::$app->view->registerCssFile($newFilePublic, [ - 'depends' => [ - UnifyThemeAsset::class - ] - ]); + \Yii::$app->view->on(View::EVENT_BEGIN_PAGE, function() use ($newFilePublic) { + \Yii::$app->view->registerCssFile($newFilePublic, [ + 'depends' => [ + UnifyThemeAsset::class + ] + ]); + }); + + //\Yii::$app->view->registerCss($content); @@ -203,11 +208,13 @@ static public function initBeforeRender() } - \Yii::$app->view->registerCssFile($newFilePublic2, [ - 'depends' => [ - UnifyThemeAsset::class - ] - ]); + \Yii::$app->view->on(View::EVENT_BEGIN_PAGE, function() use ($newFilePublic2) { + \Yii::$app->view->registerCssFile($newFilePublic2, [ + 'depends' => [ + UnifyThemeAsset::class + ] + ]); + }); if (\Yii::$app->view->theme->body_bg_image) { $bgImage = \Yii::$app->view->theme->body_bg_image; diff --git a/src/views/filters/filters.php b/src/views/filters/filters.php index 7be7958..d7c6917 100644 --- a/src/views/filters/filters.php +++ b/src/views/filters/filters.php @@ -7,6 +7,7 @@ */ /* @var $this yii\web\View */ /* @var $widget \skeeks\cms\themes\unify\widgets\filters\FiltersWidget */ + \skeeks\cms\themes\unify\widgets\filters\assets\FiltersWidgetAsset::register($this); $this->registerCss(<<