Commit 0769f724566acdfe0cb2a2c5fec3d0ac23d55807
1 parent
c886f938
Изменен метод установки языка по умолчанию
Showing
6 changed files
with
6 additions
and
12 deletions
Show diff stats
backend/views/site/index.php
| @@ -15,7 +15,6 @@ $this->title = 'My Yii Application'; | @@ -15,7 +15,6 @@ $this->title = 'My Yii Application'; | ||
| 15 | </div> | 15 | </div> |
| 16 | 16 | ||
| 17 | <div class="body-content"> | 17 | <div class="body-content"> |
| 18 | - | ||
| 19 | <div class="row"> | 18 | <div class="row"> |
| 20 | <div class="col-lg-4"> | 19 | <div class="col-lg-4"> |
| 21 | <h2>Heading</h2> | 20 | <h2>Heading</h2> |
backend/views/site/login.php
| @@ -16,6 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -16,6 +16,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
| 16 | <p>Please fill out the following fields to login:</p> | 16 | <p>Please fill out the following fields to login:</p> |
| 17 | 17 | ||
| 18 | <div class="row"> | 18 | <div class="row"> |
| 19 | + Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias aperiam aspernatur esse hic inventore iusto labore perspiciatis! Aliquam eligendi illum incidunt ipsum laboriosam nam, nostrum, odit possimus saepe unde voluptate! | ||
| 19 | <div class="col-lg-5"> | 20 | <div class="col-lg-5"> |
| 20 | <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> | 21 | <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> |
| 21 | 22 | ||
| @@ -33,3 +34,4 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -33,3 +34,4 @@ $this->params['breadcrumbs'][] = $this->title; | ||
| 33 | </div> | 34 | </div> |
| 34 | </div> | 35 | </div> |
| 35 | </div> | 36 | </div> |
| 37 | + |
common/config/params.php
| @@ -3,4 +3,5 @@ return [ | @@ -3,4 +3,5 @@ return [ | ||
| 3 | 'adminEmail' => 'admin@example.com', | 3 | 'adminEmail' => 'admin@example.com', |
| 4 | 'supportEmail' => 'support@example.com', | 4 | 'supportEmail' => 'support@example.com', |
| 5 | 'user.passwordResetTokenExpire' => 3600, | 5 | 'user.passwordResetTokenExpire' => 3600, |
| 6 | + | ||
| 6 | ]; | 7 | ]; |
common/models/Language.php
| @@ -34,7 +34,7 @@ class Language extends \yii\db\ActiveRecord | @@ -34,7 +34,7 @@ class Language extends \yii\db\ActiveRecord | ||
| 34 | self::$current = ($language === null) ? self::getDefaultLang() : $language; | 34 | self::$current = ($language === null) ? self::getDefaultLang() : $language; |
| 35 | // задаем | 35 | // задаем |
| 36 | Yii::$app->language = self::$current->lang_code; | 36 | Yii::$app->language = self::$current->lang_code; |
| 37 | - Yii::$app->lang_id = self::$current->language_id; | 37 | + Yii::$app->params['lang_id'] = self::$current->language_id; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | //Получения объекта языка по умолчанию | 40 | //Получения объекта языка по умолчанию |
common/models/Menu.php
| @@ -30,7 +30,7 @@ class Menu extends \yii\db\ActiveRecord | @@ -30,7 +30,7 @@ class Menu extends \yii\db\ActiveRecord | ||
| 30 | AND `menu_location`.menu_location_name = "'.$location_name.'" | 30 | AND `menu_location`.menu_location_name = "'.$location_name.'" |
| 31 | INNER JOIN `termin` ON `termin`.termin_id = `menu`.termin_id | 31 | INNER JOIN `termin` ON `termin`.termin_id = `menu`.termin_id |
| 32 | INNER JOIN `termin_lang` ON `termin_lang`.termin_id = `menu`.termin_id | 32 | INNER JOIN `termin_lang` ON `termin_lang`.termin_id = `menu`.termin_id |
| 33 | - AND `termin_lang`.lang_id = '.yii::$app->lang_id.' | 33 | + AND `termin_lang`.lang_id = '.yii::$app->params['lang_id.'].' |
| 34 | INNER JOIN `template` ON `template`.template_id = `termin_lang`.template_id | 34 | INNER JOIN `template` ON `template`.template_id = `termin_lang`.template_id |
| 35 | ORDER BY `menu`.level ASC, `menu`.sortorder ASC | 35 | ORDER BY `menu`.level ASC, `menu`.sortorder ASC |
| 36 | ')->queryAll(); | 36 | ')->queryAll(); |
| @@ -41,7 +41,7 @@ class Menu extends \yii\db\ActiveRecord | @@ -41,7 +41,7 @@ class Menu extends \yii\db\ActiveRecord | ||
| 41 | ->join( | 41 | ->join( |
| 42 | 'INNER JOIN', | 42 | 'INNER JOIN', |
| 43 | '`termin_lang`.termin_id = `menu`.termin_id', | 43 | '`termin_lang`.termin_id = `menu`.termin_id', |
| 44 | - ['lang_id' => yii::$app->lang_id]) | 44 | + ['lang_id' => yii::$app->params['lang_id']]) |
| 45 | ->all(); | 45 | ->all(); |
| 46 | */ | 46 | */ |
| 47 | } | 47 | } |
frontend/controllers/SiteController.php
| @@ -261,11 +261,7 @@ class SiteController extends Controller | @@ -261,11 +261,7 @@ class SiteController extends Controller | ||
| 261 | 'model' => $model, | 261 | 'model' => $model, |
| 262 | ]); | 262 | ]); |
| 263 | } | 263 | } |
| 264 | -<<<<<<< 64aac2e6acdbc009a3b87da32cede2c5c6d7b17d | ||
| 265 | 264 | ||
| 266 | -======= | ||
| 267 | - | ||
| 268 | ->>>>>>> aa2b5a028dc8d6406f78928a067b2c853625fb95 | ||
| 269 | public function actionOptions() { | 265 | public function actionOptions() { |
| 270 | $option_model = new Options(); | 266 | $option_model = new Options(); |
| 271 | $option_list = $option_model->find()->where(1)->all(); | 267 | $option_list = $option_model->find()->where(1)->all(); |
| @@ -316,9 +312,5 @@ class SiteController extends Controller | @@ -316,9 +312,5 @@ class SiteController extends Controller | ||
| 316 | } else { | 312 | } else { |
| 317 | return $this->render('index'); | 313 | return $this->render('index'); |
| 318 | } | 314 | } |
| 319 | -<<<<<<< 64aac2e6acdbc009a3b87da32cede2c5c6d7b17d | ||
| 320 | - | ||
| 321 | -======= | ||
| 322 | ->>>>>>> aa2b5a028dc8d6406f78928a067b2c853625fb95 | ||
| 323 | } | 315 | } |
| 324 | } | 316 | } |