Commit 0769f724566acdfe0cb2a2c5fec3d0ac23d55807

Authored by Yarik
1 parent c886f938

Изменен метод установки языка по умолчанию

backend/views/site/index.php
... ... @@ -15,7 +15,6 @@ $this->title = 'My Yii Application';
15 15 </div>
16 16  
17 17 <div class="body-content">
18   -
19 18 <div class="row">
20 19 <div class="col-lg-4">
21 20 <h2>Heading</h2>
... ...
backend/views/site/login.php
... ... @@ -16,6 +16,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
16 16 <p>Please fill out the following fields to login:</p>
17 17  
18 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 20 <div class="col-lg-5">
20 21 <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
21 22  
... ... @@ -33,3 +34,4 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
33 34 </div>
34 35 </div>
35 36 </div>
  37 +
... ...
common/config/params.php
... ... @@ -3,4 +3,5 @@ return [
3 3 'adminEmail' => 'admin@example.com',
4 4 'supportEmail' => 'support@example.com',
5 5 'user.passwordResetTokenExpire' => 3600,
  6 +
6 7 ];
... ...
common/models/Language.php
... ... @@ -34,7 +34,7 @@ class Language extends \yii\db\ActiveRecord
34 34 self::$current = ($language === null) ? self::getDefaultLang() : $language;
35 35 // задаем
36 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 30 AND `menu_location`.menu_location_name = "'.$location_name.'"
31 31 INNER JOIN `termin` ON `termin`.termin_id = `menu`.termin_id
32 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 34 INNER JOIN `template` ON `template`.template_id = `termin_lang`.template_id
35 35 ORDER BY `menu`.level ASC, `menu`.sortorder ASC
36 36 ')->queryAll();
... ... @@ -41,7 +41,7 @@ class Menu extends \yii\db\ActiveRecord
41 41 ->join(
42 42 'INNER JOIN',
43 43 '`termin_lang`.termin_id = `menu`.termin_id',
44   - ['lang_id' => yii::$app->lang_id])
  44 + ['lang_id' => yii::$app->params['lang_id']])
45 45 ->all();
46 46 */
47 47 }
... ...
frontend/controllers/SiteController.php
... ... @@ -261,11 +261,7 @@ class SiteController extends Controller
261 261 'model' => $model,
262 262 ]);
263 263 }
264   -<<<<<<< 64aac2e6acdbc009a3b87da32cede2c5c6d7b17d
265 264  
266   -=======
267   -
268   ->>>>>>> aa2b5a028dc8d6406f78928a067b2c853625fb95
269 265 public function actionOptions() {
270 266 $option_model = new Options();
271 267 $option_list = $option_model->find()->where(1)->all();
... ... @@ -316,9 +312,5 @@ class SiteController extends Controller
316 312 } else {
317 313 return $this->render('index');
318 314 }
319   -<<<<<<< 64aac2e6acdbc009a3b87da32cede2c5c6d7b17d
320   -
321   -=======
322   ->>>>>>> aa2b5a028dc8d6406f78928a067b2c853625fb95
323 315 }
324 316 }
... ...