From e0c5bc936b3ecfaf66cb00ec7cce040102f3438e Mon Sep 17 00:00:00 2001 From: Egorka Date: Mon, 23 Jul 2018 15:01:06 +0300 Subject: [PATCH] Frontend settings params load --- frontend/bootstrap/SetUp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/bootstrap/SetUp.php b/frontend/bootstrap/SetUp.php index b5ac060..3b68101 100644 --- a/frontend/bootstrap/SetUp.php +++ b/frontend/bootstrap/SetUp.php @@ -2,6 +2,7 @@ namespace frontend\bootstrap; +use core\entities\Settings; use yii\base\BootstrapInterface; use yii\base\Theme; use yii\helpers\ArrayHelper; @@ -24,7 +25,9 @@ class SetUp implements BootstrapInterface ], $args)); }); - // Connect frontend modules + // Load settings + $settings = ArrayHelper::map(Settings::find()->andWhere(['active' => 1])->all(), 'key', 'value', 'section'); + $app->params['settings'] = $settings; // Add finish UrlRules $app->getUrlManager()->addRules([