Commit 0f3cfa3623f8042c5da22240483cb7669df39ac9
Merge remote-tracking branch 'origin/master'
Showing
12 changed files
with
27 additions
and
147 deletions
Show diff stats
backend/config/main.php
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | require( __DIR__ . '/params.php' ), |
12 | 12 | require( __DIR__ . '/params-local.php' ) |
13 | 13 | ); |
14 | + $frontendMain = require(__DIR__.'/../../frontend/config/main.php'); | |
14 | 15 | |
15 | 16 | return [ |
16 | 17 | 'id' => 'app-backend', |
... | ... | @@ -94,22 +95,7 @@ |
94 | 95 | 'showScriptName' => false, |
95 | 96 | 'rules' => [], |
96 | 97 | ], |
97 | - 'urlManagerFrontend' => [ | |
98 | - 'class' => SeoUrlManager::className(), | |
99 | - 'enablePrettyUrl' => true, | |
100 | - 'showScriptName' => false, | |
101 | - // 'dontShowDefaulPrefix' => true, | |
102 | - 'rules' => [ | |
103 | - '\/robots.txt' => 'site/robots', | |
104 | - ], | |
105 | - 'processRoutes' => [ | |
106 | - 'object/view', | |
107 | - 'blog/article', | |
108 | - 'blog/tag', | |
109 | - 'blog/category', | |
110 | - 'page/view', | |
111 | - ], | |
112 | - ], | |
98 | + 'urlManagerFrontend' => $frontendMain['components']['urlManager'], | |
113 | 99 | 'sitemap' => [ |
114 | 100 | 'class' => Sitemap::className(), |
115 | 101 | 'entities' => [ | ... | ... |
frontend/config/main.php
... | ... | @@ -66,6 +66,15 @@ |
66 | 66 | 'blog/tag', |
67 | 67 | 'blog/category', |
68 | 68 | 'page/view', |
69 | + | |
70 | + 'site/media-about', | |
71 | + 'site/individual', | |
72 | + 'blog/index', | |
73 | + 'object/index', | |
74 | + 'site/about', | |
75 | + 'site/legal', | |
76 | + 'site/contact', | |
77 | + | |
69 | 78 | ], |
70 | 79 | ], |
71 | 80 | 'assetsAutoCompress' => [ | ... | ... |
frontend/controllers/SiteController.php
... | ... | @@ -154,21 +154,11 @@ |
154 | 154 | return $this->render('legal'); |
155 | 155 | } // юридическое |
156 | 156 | |
157 | - public function actionGreen() | |
158 | - { | |
159 | - return $this->render('green'); | |
160 | - } // зелёный тариф | |
161 | - | |
162 | 157 | public function actionMediaAbout() |
163 | 158 | { |
164 | 159 | return $this->render('media-about'); |
165 | 160 | } // СМИ о нас |
166 | 161 | |
167 | - public function actionBlog() | |
168 | - { | |
169 | - return $this->render('blog'); | |
170 | - } // блог | |
171 | - | |
172 | 162 | /** |
173 | 163 | * Action to view robots.txt file dinamycli |
174 | 164 | * | ... | ... |
frontend/views/blog/index.php
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | * |
7 | 7 | * @var View $this |
8 | 8 | * @var ActiveDataProvider $dataProvider |
9 | + * @var \artbox\core\components\SeoComponent $seo | |
9 | 10 | */ |
10 | 11 | |
11 | 12 | use yii\web\View; |
... | ... | @@ -18,6 +19,7 @@ |
18 | 19 | use yii\helpers\Url; |
19 | 20 | |
20 | 21 | $settings = Settings::getInstance(); |
22 | + $seo = \Yii::$app->get('seo'); | |
21 | 23 | |
22 | 24 | switch (Yii::$app->controller->action->id){ |
23 | 25 | |
... | ... | @@ -31,7 +33,7 @@ |
31 | 33 | $this->params['h1'] = \Yii::t('app', 'Blog Tag'); |
32 | 34 | break; |
33 | 35 | default: |
34 | - $this->params['h1'] = \Yii::t('app', 'menu-blog'); | |
36 | + $this->params['h1'] = $seo->h1; | |
35 | 37 | break; |
36 | 38 | |
37 | 39 | } | ... | ... |
frontend/views/layouts/main.php
... | ... | @@ -606,8 +606,8 @@ |
606 | 606 | <h1> |
607 | 607 | <?php |
608 | 608 | if ( |
609 | - Yii::$app->controller->id === $default_controller || | |
610 | - Yii::$app->controller->action->id === $controller->defaultAction || | |
609 | + (Yii::$app->controller->id === $default_controller and | |
610 | + Yii::$app->controller->action->id === $controller->defaultAction) || | |
611 | 611 | Yii::$app->controller->action->id === 'search' |
612 | 612 | ){ |
613 | 613 | echo (isset($this->params['h1'])) ? | ... | ... |
frontend/views/object/index.php
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | * @var View $this |
5 | 5 | * @var Feedback $contact |
6 | 6 | * @var Objectkb[] $objects |
7 | + * @var \artbox\core\components\SeoComponent $seo | |
7 | 8 | */ |
8 | 9 | |
9 | 10 | use artbox\core\models\Feedback; |
... | ... | @@ -16,8 +17,9 @@ |
16 | 17 | use yii\helpers\Url; |
17 | 18 | |
18 | 19 | $settings = Settings::getInstance(); |
20 | + $seo = \Yii::$app->get('seo'); | |
19 | 21 | |
20 | - $this->params['h1'] = \Yii::t('app', 'menu-objects'); | |
22 | + $this->params['h1'] = $seo->h1; | |
21 | 23 | $this->params[ 'breadcrumbs' ][] = $this->params['h1']; |
22 | 24 | ?> |
23 | 25 | ... | ... |
frontend/views/site/blog.php deleted
1 | -<?php | |
2 | - | |
3 | -/** | |
4 | - * @var View $this | |
5 | - * @var Feedback $contact | |
6 | - */ | |
7 | - | |
8 | -use artbox\core\models\Feedback; | |
9 | -use common\models\Settings; | |
10 | -use frontend\assets\MapAsset; | |
11 | -use yii\helpers\Html; | |
12 | -use yii\bootstrap\ActiveForm; | |
13 | -use yii\web\View; | |
14 | - | |
15 | -$settings = Settings::getInstance(); | |
16 | - | |
17 | -$this->title = \Yii::t('app', 'menu-blog'); | |
18 | -$this->params[ 'breadcrumbs' ][] = $this->title; | |
19 | -?> | |
20 | - | |
21 | -<div id="blog-wr"> | |
22 | - <div id="content"> | |
23 | - | |
24 | - </div> | |
25 | -</div> | |
26 | 0 | \ No newline at end of file |
frontend/views/site/contact.php
... | ... | @@ -14,8 +14,9 @@ |
14 | 14 | |
15 | 15 | MapAsset::register($this); |
16 | 16 | $settings = Settings::getInstance(); |
17 | + $seo = \Yii::$app->get('seo'); | |
17 | 18 | |
18 | - $this->params['h1'] = \Yii::t('app', 'menu-contacts'); | |
19 | + $this->params['h1'] = $seo->h1; | |
19 | 20 | $this->params[ 'breadcrumbs' ][] = $this->params['h1']; |
20 | 21 | |
21 | 22 | $js = <<< JS | ... | ... |
frontend/views/site/green.php deleted
1 | -<?php | |
2 | - | |
3 | -/** | |
4 | - * @var View $this | |
5 | - * @var Feedback $contact | |
6 | - */ | |
7 | - | |
8 | -use artbox\core\models\Feedback; | |
9 | -use common\models\Settings; | |
10 | -use frontend\assets\MapAsset; | |
11 | -use yii\helpers\Html; | |
12 | -use yii\bootstrap\ActiveForm; | |
13 | -use yii\web\View; | |
14 | - | |
15 | - $settings = Settings::getInstance(); | |
16 | - | |
17 | - $this->params['h1'] = \Yii::t('app', 'menu-green'); | |
18 | - $this->params[ 'breadcrumbs' ][] = $this->params['h1']; | |
19 | -?> | |
20 | - | |
21 | -<div id="green-wr"> | |
22 | - <div id="content"> | |
23 | - | |
24 | - <div class="container"> | |
25 | - | |
26 | - <section class="no-mb"> | |
27 | - <div class="row"> | |
28 | - <div class="col-md-12"> | |
29 | - | |
30 | - <p class="lead"><?= \Yii::t('app', 'green_line1') ?><br /> | |
31 | - <?= \Yii::t('app', 'green_line2') ?></p> | |
32 | - </div> | |
33 | - </div> | |
34 | - </section> | |
35 | - | |
36 | - <section class="no-mb"> | |
37 | - <div class="row"> | |
38 | - <div class="col-md-12"> | |
39 | - <div class="heading"> | |
40 | - <h3><?= \Yii::t('app', 'green_line3') ?></h3> | |
41 | - </div> | |
42 | - </div> | |
43 | - </div> | |
44 | - </section> | |
45 | - <section class="green-carousel"> | |
46 | - <div class="project owl-carousel"> | |
47 | - <div class="item"> | |
48 | - <img src="/img/slt01.jpg" alt="" class="img-responsive text-center"> | |
49 | - </div> | |
50 | - <div class="item"> | |
51 | - <img class="img-responsive text-center" src="/img/slt02.jpg" alt=""> | |
52 | - </div> | |
53 | - <div class="item"> | |
54 | - <img class="img-responsive text-center" src="/img/slt03.jpg" alt=""> | |
55 | - </div> | |
56 | - <div class="item"> | |
57 | - <img class="img-responsive text-center" src="/img/slt04.jpg" alt=""> | |
58 | - </div> | |
59 | - </div> | |
60 | - <div class="box-simple"> | |
61 | - <a href="#" class="btn button1 icon_phone modaled init-button-consultation" data-title="<?= \Yii::t('app', 'green_get') ?> <?= \Yii::t('app', 'green_get2') ?>" data-toggle="modal" data-target="#feedback-modal"> | |
62 | - <?= \Yii::t('app', 'green_get') ?> <span><?= \Yii::t('app', 'green_get2') ?></span> | |
63 | - </a> | |
64 | - </div> | |
65 | - <!-- /.project owl-slider --> | |
66 | - </section> | |
67 | - | |
68 | - <section> | |
69 | - <div class="row portfolio-project"> | |
70 | - <div class="col-md-12"> | |
71 | - <p class="lead"><?= \Yii::t('app', 'green_line4') ?></p> | |
72 | - <div class="heading"> | |
73 | - <h3><?= \Yii::t('app', 'green_line5') ?></h3> | |
74 | - </div> | |
75 | - <ul class="lead"> | |
76 | - <li><?= \Yii::t('app', 'green_line6') ?></li> | |
77 | - <li><?= \Yii::t('app', 'green_line7') ?></li> | |
78 | - <li><?= \Yii::t('app', 'green_line8') ?></li> | |
79 | - <li><?= \Yii::t('app', 'green_line9') ?></li> | |
80 | - </ul> | |
81 | - | |
82 | - </div> | |
83 | - </div> | |
84 | - </section> | |
85 | - | |
86 | - </div> | |
87 | - </div> | |
88 | -</div> | |
89 | 0 | \ No newline at end of file |
frontend/views/site/individual.php
... | ... | @@ -17,8 +17,9 @@ |
17 | 17 | use common\models\Objectkb; |
18 | 18 | |
19 | 19 | $settings = Settings::getInstance(); |
20 | + $seo = \Yii::$app->get('seo'); | |
20 | 21 | |
21 | - $this->params['h1'] = \Yii::t('app', 'menu-individual'); | |
22 | + $this->params['h1'] = $seo->h1; | |
22 | 23 | $this->params[ 'breadcrumbs' ][] = $this->params['h1']; |
23 | 24 | ?> |
24 | 25 | <div id="individual-wr"> | ... | ... |
frontend/views/site/legal.php
... | ... | @@ -14,8 +14,9 @@ use yii\web\View; |
14 | 14 | |
15 | 15 | MapAsset::register($this); |
16 | 16 | $settings = Settings::getInstance(); |
17 | +$seo = \Yii::$app->get('seo'); | |
17 | 18 | |
18 | -$this->params['h1'] = ""; | |
19 | +$this->params['h1'] = $seo->h1; | |
19 | 20 | $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'menu-legal'); |
20 | 21 | |
21 | 22 | $js = <<< JS | ... | ... |
frontend/views/site/media-about.php
... | ... | @@ -13,8 +13,9 @@ use yii\bootstrap\ActiveForm; |
13 | 13 | use yii\web\View; |
14 | 14 | |
15 | 15 | $settings = Settings::getInstance(); |
16 | + $seo = \Yii::$app->get('seo'); | |
16 | 17 | |
17 | - $this->params['h1'] = \Yii::t('app', 'menu-mediaabout'); | |
18 | + $this->params['h1'] = $seo->h1; | |
18 | 19 | $this->params[ 'breadcrumbs' ][] = $this->params['h1']; |
19 | 20 | ?> |
20 | 21 | ... | ... |