Commit 310f45426995fc9c0fd2af8eb5e43409723c9b9d
1 parent
f9a837af
Namespaces
Showing
21 changed files
with
856 additions
and
11 deletions
Show diff stats
Module.php
controllers/SeoCategoryController.php
1 | 1 | <?php |
2 | 2 | |
3 | - namespace backend\controllers; | |
3 | + namespace artweb\artbox\seo\controllers; | |
4 | 4 | |
5 | 5 | use Yii; |
6 | - use artweb\artbox\models\SeoCategory; | |
7 | - use artweb\artbox\models\SeoCategorySearch; | |
6 | + use artweb\artbox\seo\models\SeoCategory; | |
7 | + use artweb\artbox\seo\models\SeoCategorySearch; | |
8 | 8 | use yii\web\Controller; |
9 | 9 | use yii\web\NotFoundHttpException; |
10 | 10 | use yii\filters\VerbFilter; | ... | ... |
controllers/SeoController.php
1 | 1 | <?php |
2 | 2 | |
3 | - namespace backend\controllers; | |
3 | + namespace artweb\artbox\seo\controllers; | |
4 | 4 | |
5 | 5 | use Yii; |
6 | - use artweb\artbox\models\Seo; | |
7 | - use artweb\artbox\models\SeoSearch; | |
6 | + use artweb\artbox\seo\models\Seo; | |
7 | + use artweb\artbox\seo\models\SeoSearch; | |
8 | 8 | use yii\web\Controller; |
9 | 9 | use yii\web\NotFoundHttpException; |
10 | 10 | use yii\filters\VerbFilter; | ... | ... |
controllers/SeoDynamicController.php
1 | 1 | <?php |
2 | 2 | |
3 | - namespace backend\controllers; | |
3 | + namespace artweb\artbox\seo\controllers; | |
4 | 4 | |
5 | - use artweb\artbox\models\SeoCategory; | |
5 | + use artweb\artbox\seo\models\SeoCategory; | |
6 | 6 | use Yii; |
7 | - use artweb\artbox\models\SeoDynamic; | |
8 | - use artweb\artbox\models\SeoDynamicSearch; | |
7 | + use artweb\artbox\seo\models\SeoDynamic; | |
8 | + use artweb\artbox\seo\models\SeoDynamicSearch; | |
9 | 9 | use yii\web\Controller; |
10 | 10 | use yii\web\NotFoundHttpException; |
11 | 11 | use yii\filters\VerbFilter; | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use common\models\SeoCategoryLang; | |
5 | + use common\modules\language\widgets\LanguageForm; | |
6 | + use yii\helpers\Html; | |
7 | + use yii\web\View; | |
8 | + use yii\widgets\ActiveForm; | |
9 | + | |
10 | + /** | |
11 | + * @var View $this | |
12 | + * @var SeoCategory $model | |
13 | + * @var SeoCategoryLang[] $modelLangs | |
14 | + * @var ActiveForm $form | |
15 | + */ | |
16 | +?> | |
17 | + | |
18 | +<div class="seo-category-form"> | |
19 | + | |
20 | + <?php $form = ActiveForm::begin(); ?> | |
21 | + | |
22 | + <?= $form->field($model, 'controller') | |
23 | + ->textInput([ 'maxlength' => true ]) ?> | |
24 | + | |
25 | + <?= $form->field($model, 'status') | |
26 | + ->textInput() ?> | |
27 | + | |
28 | + <?= LanguageForm::widget([ | |
29 | + 'modelLangs' => $modelLangs, | |
30 | + 'formView' => '@backend/views/seo-category/_form_language', | |
31 | + 'form' => $form, | |
32 | + ]) ?> | |
33 | + | |
34 | + <div class="form-group"> | |
35 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?> | |
36 | + </div> | |
37 | + | |
38 | + <?php ActiveForm::end(); ?> | |
39 | + | |
40 | +</div> | ... | ... |
1 | +<?php | |
2 | + use common\models\SeoCategoryLang; | |
3 | + use common\modules\language\models\Language; | |
4 | + use yii\web\View; | |
5 | + use yii\widgets\ActiveForm; | |
6 | + | |
7 | + /** | |
8 | + * @var SeoCategoryLang $model_lang | |
9 | + * @var Language $language | |
10 | + * @var ActiveForm $form | |
11 | + * @var View $this | |
12 | + */ | |
13 | +?> | |
14 | +<?= $form->field($model_lang, '[' . $language->id . ']title') | |
15 | + ->textInput([ 'maxlength' => true ]); ?> | |
0 | 16 | \ No newline at end of file | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use common\models\SeoCategoryLang; | |
5 | + use yii\helpers\Html; | |
6 | + use yii\web\View; | |
7 | + | |
8 | + /** | |
9 | + * @var View $this | |
10 | + * @var SeoCategory $model | |
11 | + * @var SeoCategoryLang[] $modelLangs | |
12 | + */ | |
13 | + | |
14 | + $this->title = Yii::t('app', 'Create Seo Category'); | |
15 | + $this->params[ 'breadcrumbs' ][] = [ | |
16 | + 'label' => Yii::t('app', 'Seo Categories'), | |
17 | + 'url' => [ 'index' ], | |
18 | + ]; | |
19 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
20 | +?> | |
21 | +<div class="seo-category-create"> | |
22 | + | |
23 | + <h1><?= Html::encode($this->title) ?></h1> | |
24 | + | |
25 | + <?= $this->render('_form', [ | |
26 | + 'model' => $model, | |
27 | + 'modelLangs' => $modelLangs, | |
28 | + ]) ?> | |
29 | + | |
30 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\grid\GridView; | |
5 | + use yii\helpers\Url; | |
6 | + | |
7 | + /** | |
8 | + * @var yii\web\View $this | |
9 | + * @var common\models\SeoCategorySearch $searchModel | |
10 | + * @var yii\data\ActiveDataProvider $dataProvider | |
11 | + */ | |
12 | + $this->title = Yii::t('app', 'Seo Categories'); | |
13 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
14 | +?> | |
15 | +<div class="seo-category-index"> | |
16 | + | |
17 | + <h1><?= Html::encode($this->title) ?></h1> | |
18 | + | |
19 | + <p> | |
20 | + <?= Html::a(Yii::t('app', 'Create Seo Category'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
21 | + </p> | |
22 | + <?= GridView::widget( | |
23 | + [ | |
24 | + 'dataProvider' => $dataProvider, | |
25 | + 'filterModel' => $searchModel, | |
26 | + 'columns' => [ | |
27 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
28 | + 'id', | |
29 | + 'controller', | |
30 | + [ | |
31 | + 'attribute' => 'title', | |
32 | + 'value' => 'lang.title', | |
33 | + ], | |
34 | + 'status', | |
35 | + [ | |
36 | + 'class' => 'yii\grid\ActionColumn', | |
37 | + 'template' => '{update} {image} {delete}', | |
38 | + 'buttons' => [ | |
39 | + 'image' => function ($url, $model) { | |
40 | + return Html::a( | |
41 | + '<span class="glyphicon glyphicon-picture"></span>', | |
42 | + Url::toRoute( | |
43 | + [ | |
44 | + 'seo-dynamic/index', | |
45 | + 'seo_category_id' => $model->id, | |
46 | + ] | |
47 | + ), | |
48 | + [ | |
49 | + 'title' => \Yii::t('app', 'слайды'), | |
50 | + ] | |
51 | + ); | |
52 | + }, | |
53 | + ], | |
54 | + ], | |
55 | + ], | |
56 | + ] | |
57 | + ); ?> | |
58 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use common\models\SeoCategoryLang; | |
5 | + use yii\helpers\Html; | |
6 | + use yii\web\View; | |
7 | + | |
8 | + /** | |
9 | + * @var View $this | |
10 | + * @var SeoCategory $model | |
11 | + * @var SeoCategoryLang[] $modelLangs | |
12 | + */ | |
13 | + | |
14 | + $this->title = Yii::t('app', 'Update {modelClass}: ', [ | |
15 | + 'modelClass' => 'Seo Category', | |
16 | + ]) . $model->lang->title; | |
17 | + $this->params[ 'breadcrumbs' ][] = [ | |
18 | + 'label' => Yii::t('app', 'Seo Categories'), | |
19 | + 'url' => [ 'index' ], | |
20 | + ]; | |
21 | + $this->params[ 'breadcrumbs' ][] = [ | |
22 | + 'label' => $model->lang->title, | |
23 | + 'url' => [ | |
24 | + 'view', | |
25 | + 'id' => $model->id, | |
26 | + ], | |
27 | + ]; | |
28 | + $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update'); | |
29 | +?> | |
30 | +<div class="seo-category-update"> | |
31 | + | |
32 | + <h1><?= Html::encode($this->title) ?></h1> | |
33 | + | |
34 | + <?= $this->render('_form', [ | |
35 | + 'model' => $model, | |
36 | + 'modelLangs' => $modelLangs, | |
37 | + ]) ?> | |
38 | + | |
39 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoDynamic; | |
4 | + use common\models\SeoDynamicLang; | |
5 | + use common\modules\language\widgets\LanguageForm; | |
6 | + use yii\helpers\Html; | |
7 | + use yii\web\View; | |
8 | + use yii\widgets\ActiveForm; | |
9 | + | |
10 | + /** | |
11 | + * @var View $this | |
12 | + * @var SeoDynamic $model | |
13 | + * @var SeoDynamicLang[] $modelLangs | |
14 | + * @var int $seo_category_id | |
15 | + * @var ActiveForm $form | |
16 | + */ | |
17 | +?> | |
18 | +<style> | |
19 | + #seodynamic-filter_mod { | |
20 | + display: none; | |
21 | + } | |
22 | +</style> | |
23 | +<div class="seo-dynamic-form"> | |
24 | + | |
25 | + <?php $form = ActiveForm::begin(); ?> | |
26 | + | |
27 | + <?= $form->field($model, 'action') | |
28 | + ->textInput([ 'maxlength' => true ]) ?> | |
29 | + | |
30 | + <?= $form->field($model, 'param') | |
31 | + ->textInput([ 'maxlength' => true ]) ?> | |
32 | + | |
33 | + <?= $form->field($model, 'fields') | |
34 | + ->textInput([ 'maxlength' => true ]) ?> | |
35 | + | |
36 | + <?= $form->field($model, 'status') | |
37 | + ->textInput() ?> | |
38 | + | |
39 | + <?= LanguageForm::widget([ | |
40 | + 'modelLangs' => $modelLangs, | |
41 | + 'formView' => '@backend/views/seo-dynamic/_form_language', | |
42 | + 'form' => $form, | |
43 | + ]) ?> | |
44 | + | |
45 | + <div class="form-group"> | |
46 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?> | |
47 | + </div> | |
48 | + | |
49 | + <?php ActiveForm::end(); ?> | |
50 | +</div> | ... | ... |
1 | +<?php | |
2 | + use common\models\SeoDynamicLang; | |
3 | + use common\modules\language\models\Language; | |
4 | + use mihaildev\ckeditor\CKEditor; | |
5 | + use mihaildev\elfinder\ElFinder; | |
6 | + use yii\web\View; | |
7 | + use yii\widgets\ActiveForm; | |
8 | + | |
9 | + /** | |
10 | + * @var SeoDynamicLang $model_lang | |
11 | + * @var Language $language | |
12 | + * @var ActiveForm $form | |
13 | + * @var View $this | |
14 | + */ | |
15 | +?> | |
16 | +<?= $form->field($model_lang, '[' . $language->id . ']title') | |
17 | + ->textInput([ 'maxlength' => true ]); ?> | |
18 | +<?= $form->field($model_lang, '[' . $language->id . ']meta_title') | |
19 | + ->textInput(); ?> | |
20 | +<?= $form->field($model_lang, '[' . $language->id . ']meta_description') | |
21 | + ->widget(CKEditor::className(), [ | |
22 | + 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [ | |
23 | + 'preset' => 'full', | |
24 | + 'inline' => false, | |
25 | + 'filebrowserUploadUrl' => Yii::$app->getUrlManager() | |
26 | + ->createUrl('file/uploader/images-upload'), | |
27 | + ]), | |
28 | + ]) ?> | |
29 | + | |
30 | +<?= $form->field($model_lang, '[' . $language->id . ']seo_text') | |
31 | + ->widget(CKEditor::className(), [ | |
32 | + 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [ | |
33 | + 'preset' => 'full', | |
34 | + 'inline' => false, | |
35 | + 'filebrowserUploadUrl' => Yii::$app->getUrlManager() | |
36 | + ->createUrl('file/uploader/images-upload'), | |
37 | + ]), | |
38 | + ]) ?> | |
39 | +<?= $form->field($model_lang, '[' . $language->id . ']key') | |
40 | + ->textInput([ 'maxlength' => true ]) ?> | |
41 | +<?= $form->field($model_lang, '[' . $language->id . ']h1') | |
42 | + ->textInput([ 'maxlength' => true ]) ?> | |
43 | + | |
44 | +<?= $form->field($model_lang, '[' . $language->id . ']meta') | |
45 | + ->textInput([ 'maxlength' => true ]) ?> | |
0 | 46 | \ No newline at end of file | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use common\models\SeoDynamic; | |
5 | + use common\models\SeoDynamicLang; | |
6 | + use yii\helpers\Html; | |
7 | + use yii\helpers\Url; | |
8 | + use yii\web\View; | |
9 | + | |
10 | + /** | |
11 | + * @var View $this | |
12 | + * @var SeoDynamic $model | |
13 | + * @var SeoDynamicLang[] $modelLangs | |
14 | + * @var SeoCategory $seo_category | |
15 | + */ | |
16 | + | |
17 | + $this->title = Yii::t('app', 'Create Seo Dynamic'); | |
18 | + $this->params[ 'breadcrumbs' ][] = [ | |
19 | + 'label' => Yii::t('app', 'Seo Categories'), | |
20 | + 'url' => [ '/seo-category/index' ], | |
21 | + ]; | |
22 | + $this->params[ 'breadcrumbs' ][] = [ | |
23 | + 'label' => $seo_category->lang->title, | |
24 | + 'url' => [ | |
25 | + 'index', | |
26 | + 'seo_category_id' => $seo_category->id, | |
27 | + ], | |
28 | + ]; | |
29 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
30 | +?> | |
31 | +<div class="seo-dynamic-create"> | |
32 | + | |
33 | + <h1><?= Html::encode($this->title) ?></h1> | |
34 | + | |
35 | + <?= $this->render( | |
36 | + '_form', | |
37 | + [ | |
38 | + 'model' => $model, | |
39 | + 'modelLangs' => $modelLangs, | |
40 | + ] | |
41 | + ) ?> | |
42 | + | |
43 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use yii\helpers\Html; | |
5 | + use yii\grid\GridView; | |
6 | + use yii\helpers\Url; | |
7 | + | |
8 | + /** | |
9 | + * @var yii\web\View $this | |
10 | + * @var common\models\SeoDynamicSearch $searchModel | |
11 | + * @var yii\data\ActiveDataProvider $dataProvider | |
12 | + * @var SeoCategory $seo_category | |
13 | + */ | |
14 | + $this->title = Yii::t( | |
15 | + 'app', | |
16 | + 'Seo Dynamics for {seo_category}', | |
17 | + [ | |
18 | + 'seo_category' => $seo_category->lang->title, | |
19 | + ] | |
20 | + ); | |
21 | + $this->params[ 'breadcrumbs' ][] = [ | |
22 | + 'label' => \Yii::t('app', 'Seo Categories'), | |
23 | + 'url' => [ '/seo-category/index' ], | |
24 | + ]; | |
25 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
26 | +?> | |
27 | +<div class="seo-dynamic-index"> | |
28 | + | |
29 | + <h1><?= Html::encode($this->title) ?></h1> | |
30 | + | |
31 | + <p> | |
32 | + <?= Html::a( | |
33 | + Yii::t('app', 'Create Seo Dynamic'), | |
34 | + Url::toRoute( | |
35 | + [ | |
36 | + 'create', | |
37 | + 'seo_category_id' => $seo_category->id, | |
38 | + ] | |
39 | + ), | |
40 | + [ 'class' => 'btn btn-success' ] | |
41 | + ) ?> | |
42 | + </p> | |
43 | + <?= GridView::widget( | |
44 | + [ | |
45 | + 'dataProvider' => $dataProvider, | |
46 | + 'filterModel' => $searchModel, | |
47 | + 'columns' => [ | |
48 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
49 | + 'id', | |
50 | + [ | |
51 | + 'attribute' => 'title', | |
52 | + 'value' => 'lang.title', | |
53 | + ], | |
54 | + 'action', | |
55 | + 'fields', | |
56 | + 'param', | |
57 | + 'status', | |
58 | + [ | |
59 | + 'class' => 'yii\grid\ActionColumn', | |
60 | + 'buttons' => [ | |
61 | + 'view' => function ($url, $model) { | |
62 | + return Html::a( | |
63 | + '<span class="glyphicon glyphicon-eye-open"></span>', | |
64 | + [ | |
65 | + 'view', | |
66 | + 'seo_category_id' => $model->id, | |
67 | + 'id' => $model->id, | |
68 | + ], | |
69 | + [ | |
70 | + 'title' => \Yii::t('app', 'Просмотр'), | |
71 | + ] | |
72 | + ); | |
73 | + }, | |
74 | + 'update' => function ($url, $model) { | |
75 | + return Html::a( | |
76 | + '<span class="glyphicon glyphicon-pencil"></span>', | |
77 | + [ | |
78 | + 'update', | |
79 | + 'seo_category_id' => $model->seo_category_id, | |
80 | + 'id' => $model->id, | |
81 | + ], | |
82 | + [ | |
83 | + 'title' => \Yii::t('app', 'Редактировать'), | |
84 | + ] | |
85 | + ); | |
86 | + }, | |
87 | + 'delete' => function ($url, $model) { | |
88 | + | |
89 | + return Html::a( | |
90 | + '<span class="glyphicon glyphicon-trash"></span>', | |
91 | + Url::toRoute( | |
92 | + [ | |
93 | + 'delete', | |
94 | + 'seo_category_id' => $model->seo_category_id, | |
95 | + 'id' => $model->id, | |
96 | + ] | |
97 | + ), | |
98 | + [ | |
99 | + 'title' => Yii::t('yii', 'Delete'), | |
100 | + 'data-confirm' => Yii::t('yii', 'Are you sure to delete this item?'), | |
101 | + 'data-method' => 'post', | |
102 | + ] | |
103 | + ); | |
104 | + | |
105 | + }, | |
106 | + ], | |
107 | + ], | |
108 | + ], | |
109 | + ] | |
110 | + ); ?> | |
111 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use common\models\SeoDynamic; | |
5 | + use common\models\SeoDynamicLang; | |
6 | + use yii\helpers\Html; | |
7 | + use yii\web\View; | |
8 | + | |
9 | + /** | |
10 | + * @var View $this | |
11 | + * @var SeoDynamic $model | |
12 | + * @var SeoDynamicLang[] $modelLangs | |
13 | + * @var SeoCategory $seo_category | |
14 | + */ | |
15 | + | |
16 | + $this->title = Yii::t( | |
17 | + 'app', | |
18 | + 'Update {modelClass}: ', | |
19 | + [ | |
20 | + 'modelClass' => 'Seo Dynamic', | |
21 | + ] | |
22 | + ) . $model->lang->title; | |
23 | + $this->params[ 'breadcrumbs' ][] = [ | |
24 | + 'label' => Yii::t('app', 'Seo Categories'), | |
25 | + 'url' => [ '/seo-category/index' ], | |
26 | + ]; | |
27 | + $this->params[ 'breadcrumbs' ][] = [ | |
28 | + 'label' => $seo_category->lang->title, | |
29 | + 'url' => [ | |
30 | + 'index', | |
31 | + 'seo_category_id' => $seo_category->id, | |
32 | + ], | |
33 | + ]; | |
34 | + $this->params[ 'breadcrumbs' ][] = [ | |
35 | + 'label' => $model->lang->title, | |
36 | + 'url' => [ | |
37 | + 'view', | |
38 | + 'seo_category_id' => $seo_category->id, | |
39 | + 'id' => $model->id, | |
40 | + ], | |
41 | + ]; | |
42 | + $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update'); | |
43 | +?> | |
44 | +<div class="seo-dynamic-update"> | |
45 | + | |
46 | + <h1><?= Html::encode($this->title) ?></h1> | |
47 | + | |
48 | + <?= $this->render( | |
49 | + '_form', | |
50 | + [ | |
51 | + 'model' => $model, | |
52 | + 'modelLangs' => $modelLangs, | |
53 | + ] | |
54 | + ) ?> | |
55 | + | |
56 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\SeoCategory; | |
4 | + use yii\helpers\Html; | |
5 | + use yii\widgets\DetailView; | |
6 | + | |
7 | + /** | |
8 | + * @var yii\web\View $this | |
9 | + * @var common\models\SeoDynamic $model | |
10 | + * @var SeoCategory $seo_category | |
11 | + */ | |
12 | + $this->title = $model->lang->title; | |
13 | + $this->params[ 'breadcrumbs' ][] = [ | |
14 | + 'label' => Yii::t('app', 'Seo Categories'), | |
15 | + 'url' => [ '/seo-category/index' ], | |
16 | + ]; | |
17 | + $this->params[ 'breadcrumbs' ][] = [ | |
18 | + 'label' => $seo_category->lang->title, | |
19 | + 'url' => [ | |
20 | + 'index', | |
21 | + 'seo_category_id' => $seo_category->id, | |
22 | + ], | |
23 | + ]; | |
24 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
25 | +?> | |
26 | +<div class="seo-dynamic-view"> | |
27 | + | |
28 | + <h1><?= Html::encode($this->title) ?></h1> | |
29 | + | |
30 | + <p> | |
31 | + <?= Html::a( | |
32 | + Yii::t('app', 'Update'), | |
33 | + [ | |
34 | + 'update', | |
35 | + 'id' => $model->id, | |
36 | + 'seo_category_id' => $seo_category->id, | |
37 | + ], | |
38 | + [ 'class' => 'btn btn-primary' ] | |
39 | + ) ?> | |
40 | + <?= Html::a( | |
41 | + Yii::t('app', 'Delete'), | |
42 | + [ | |
43 | + 'delete', | |
44 | + 'id' => $model->id, | |
45 | + 'seo_category_id' => $seo_category->id, | |
46 | + ], | |
47 | + [ | |
48 | + 'class' => 'btn btn-danger', | |
49 | + 'data' => [ | |
50 | + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | |
51 | + 'method' => 'post', | |
52 | + ], | |
53 | + ] | |
54 | + ) ?> | |
55 | + </p> | |
56 | + | |
57 | + <?= DetailView::widget( | |
58 | + [ | |
59 | + 'model' => $model, | |
60 | + 'attributes' => [ | |
61 | + 'id', | |
62 | + [ | |
63 | + 'label' => \Yii::t('app', 'Seo Category'), | |
64 | + 'value' => Html::a( | |
65 | + $seo_category->lang->title, | |
66 | + [ | |
67 | + 'index', | |
68 | + 'seo_category_id' => $seo_category->id, | |
69 | + ] | |
70 | + ), | |
71 | + 'format' => 'html', | |
72 | + ], | |
73 | + 'lang.title', | |
74 | + 'action', | |
75 | + 'fields', | |
76 | + 'param', | |
77 | + 'status', | |
78 | + 'lang.meta_title', | |
79 | + 'lang.h1', | |
80 | + 'lang.key', | |
81 | + 'lang.meta', | |
82 | + 'lang.meta_description', | |
83 | + 'lang.seo_text', | |
84 | + ], | |
85 | + ] | |
86 | + ) ?> | |
87 | + | |
88 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\Seo; | |
4 | + use common\models\SeoLang; | |
5 | + use common\modules\language\widgets\LanguageForm; | |
6 | + use yii\helpers\Html; | |
7 | + use yii\web\View; | |
8 | + use yii\widgets\ActiveForm; | |
9 | + | |
10 | + /** | |
11 | + * @var View $this | |
12 | + * @var Seo $model | |
13 | + * @var SeoLang[] $modelLangs | |
14 | + * @var ActiveForm $form | |
15 | + */ | |
16 | +?> | |
17 | + | |
18 | +<div class="seo-form"> | |
19 | + | |
20 | + <?php $form = ActiveForm::begin(); ?> | |
21 | + | |
22 | + <?= $form->field($model, 'url') | |
23 | + ->textInput([ 'maxlength' => true ]) ?> | |
24 | + | |
25 | + <?= LanguageForm::widget([ | |
26 | + 'modelLangs' => $modelLangs, | |
27 | + 'formView' => '@backend/views/seo/_form_language', | |
28 | + 'form' => $form, | |
29 | + ]) ?> | |
30 | + | |
31 | + <div class="form-group"> | |
32 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?> | |
33 | + </div> | |
34 | + | |
35 | + <?php ActiveForm::end(); ?> | |
36 | + | |
37 | +</div> | ... | ... |
1 | +<?php | |
2 | + use common\models\SeoLang; | |
3 | + use common\modules\language\models\Language; | |
4 | + use mihaildev\ckeditor\CKEditor; | |
5 | + use mihaildev\elfinder\ElFinder; | |
6 | + use yii\web\View; | |
7 | + use yii\widgets\ActiveForm; | |
8 | + | |
9 | + /** | |
10 | + * @var SeoLang $model_lang | |
11 | + * @var Language $language | |
12 | + * @var ActiveForm $form | |
13 | + * @var View $this | |
14 | + */ | |
15 | +?> | |
16 | +<?= $form->field($model_lang, '[' . $language->id . ']title') | |
17 | + ->textInput([ 'maxlength' => true ]); ?> | |
18 | + | |
19 | +<?= $form->field($model_lang, '[' . $language->id . ']meta_description') | |
20 | + ->widget(CKEditor::className(), [ | |
21 | + 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [ | |
22 | + 'preset' => 'full', | |
23 | + 'inline' => false, | |
24 | + 'filebrowserUploadUrl' => Yii::$app->getUrlManager() | |
25 | + ->createUrl('file/uploader/images-upload'), | |
26 | + ]), | |
27 | + ]) ?> | |
28 | + | |
29 | +<?= $form->field($model_lang, '[' . $language->id . ']seo_text') | |
30 | + ->widget(CKEditor::className(), [ | |
31 | + 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [ | |
32 | + 'preset' => 'full', | |
33 | + 'inline' => false, | |
34 | + 'filebrowserUploadUrl' => Yii::$app->getUrlManager() | |
35 | + ->createUrl('file/uploader/images-upload'), | |
36 | + ]), | |
37 | + ]) ?> | |
38 | + | |
39 | +<?= $form->field($model_lang, '[' . $language->id . ']h1') | |
40 | + ->textInput([ 'maxlength' => true ]) ?> | |
41 | + | |
42 | +<?= $form->field($model_lang, '[' . $language->id . ']meta') | |
43 | + ->textInput([ 'maxlength' => true ]) ?> | |
0 | 44 | \ No newline at end of file | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\Seo; | |
4 | + use common\models\SeoLang; | |
5 | + use yii\helpers\Html; | |
6 | + use yii\web\View; | |
7 | + | |
8 | + /** | |
9 | + * @var View $this | |
10 | + * @var Seo $model | |
11 | + * @var SeoLang[] $modelLangs | |
12 | + */ | |
13 | + | |
14 | + $this->title = Yii::t('app', 'Create Seo'); | |
15 | + $this->params[ 'breadcrumbs' ][] = [ | |
16 | + 'label' => Yii::t('app', 'Seos'), | |
17 | + 'url' => [ 'index' ], | |
18 | + ]; | |
19 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
20 | +?> | |
21 | +<div class="seo-create"> | |
22 | + | |
23 | + <h1><?= Html::encode($this->title) ?></h1> | |
24 | + | |
25 | + <?= $this->render('_form', [ | |
26 | + 'model' => $model, | |
27 | + 'modelLangs' => $modelLangs, | |
28 | + ]) ?> | |
29 | + | |
30 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\grid\GridView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\SeoSearch $searchModel | |
9 | + * @var yii\data\ActiveDataProvider $dataProvider | |
10 | + */ | |
11 | + $this->title = Yii::t('app', 'Seo'); | |
12 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
13 | +?> | |
14 | +<div class="seo-index"> | |
15 | + | |
16 | + <h1><?= Html::encode($this->title) ?></h1> | |
17 | + | |
18 | + <p> | |
19 | + <?= Html::a(Yii::t('app', 'Create Seo'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
20 | + </p> | |
21 | + <?= GridView::widget( | |
22 | + [ | |
23 | + 'dataProvider' => $dataProvider, | |
24 | + 'filterModel' => $searchModel, | |
25 | + 'columns' => [ | |
26 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
27 | + 'id', | |
28 | + 'url', | |
29 | + [ | |
30 | + 'attribute' => 'title', | |
31 | + 'value' => 'lang.title', | |
32 | + ], | |
33 | + [ | |
34 | + 'attribute' => 'meta_description', | |
35 | + 'value' => 'lang.meta_description', | |
36 | + ], | |
37 | + [ | |
38 | + 'attribute' => 'h1', | |
39 | + 'value' => 'lang.h1', | |
40 | + ], | |
41 | + [ | |
42 | + 'attribute' => 'meta', | |
43 | + 'value' => 'lang.meta', | |
44 | + ], | |
45 | + [ | |
46 | + 'attribute' => 'seo_text', | |
47 | + 'value' => 'lang.seo_text', | |
48 | + ], | |
49 | + [ 'class' => 'yii\grid\ActionColumn' ], | |
50 | + ], | |
51 | + ] | |
52 | + ); ?> | |
53 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use common\models\Seo; | |
4 | + use common\models\SeoLang; | |
5 | + use yii\helpers\Html; | |
6 | + use yii\web\View; | |
7 | + | |
8 | + /** | |
9 | + * @var View $this | |
10 | + * @var Seo $model | |
11 | + * @var SeoLang[] $modelLangs | |
12 | + */ | |
13 | + | |
14 | + $this->title = Yii::t( | |
15 | + 'app', | |
16 | + 'Update {modelClass}: ', | |
17 | + [ | |
18 | + 'modelClass' => 'Seo', | |
19 | + ] | |
20 | + ) . $model->url; | |
21 | + $this->params[ 'breadcrumbs' ][] = [ | |
22 | + 'label' => Yii::t('app', 'Seos'), | |
23 | + 'url' => [ 'index' ], | |
24 | + ]; | |
25 | + $this->params[ 'breadcrumbs' ][] = [ | |
26 | + 'label' => $model->url, | |
27 | + 'url' => [ | |
28 | + 'view', | |
29 | + 'id' => $model->id, | |
30 | + ], | |
31 | + ]; | |
32 | + $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update'); | |
33 | +?> | |
34 | +<div class="seo-update"> | |
35 | + | |
36 | + <h1><?= Html::encode($this->title) ?></h1> | |
37 | + | |
38 | + <?= $this->render( | |
39 | + '_form', | |
40 | + [ | |
41 | + 'model' => $model, | |
42 | + 'modelLangs' => $modelLangs, | |
43 | + ] | |
44 | + ) ?> | |
45 | + | |
46 | +</div> | ... | ... |
1 | +<?php | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\widgets\DetailView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\Seo $model | |
9 | + */ | |
10 | + $this->title = $model->url; | |
11 | + $this->params[ 'breadcrumbs' ][] = [ | |
12 | + 'label' => Yii::t('app', 'Seos'), | |
13 | + 'url' => [ 'index' ], | |
14 | + ]; | |
15 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
16 | +?> | |
17 | +<div class="seo-view"> | |
18 | + | |
19 | + <h1><?= Html::encode($this->title) ?></h1> | |
20 | + | |
21 | + <p> | |
22 | + <?= Html::a( | |
23 | + Yii::t('app', 'Update'), | |
24 | + [ | |
25 | + 'update', | |
26 | + 'id' => $model->id, | |
27 | + ], | |
28 | + [ 'class' => 'btn btn-primary' ] | |
29 | + ) ?> | |
30 | + <?= Html::a( | |
31 | + Yii::t('app', 'Delete'), | |
32 | + [ | |
33 | + 'delete', | |
34 | + 'id' => $model->id, | |
35 | + ], | |
36 | + [ | |
37 | + 'class' => 'btn btn-danger', | |
38 | + 'data' => [ | |
39 | + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | |
40 | + 'method' => 'post', | |
41 | + ], | |
42 | + ] | |
43 | + ) ?> | |
44 | + </p> | |
45 | + | |
46 | + <?= DetailView::widget( | |
47 | + [ | |
48 | + 'model' => $model, | |
49 | + 'attributes' => [ | |
50 | + 'id', | |
51 | + 'url', | |
52 | + 'lang.title', | |
53 | + 'lang.meta_description', | |
54 | + 'lang.h1', | |
55 | + 'lang.meta', | |
56 | + 'lang.seo_text', | |
57 | + ], | |
58 | + ] | |
59 | + ) ?> | |
60 | + | |
61 | +</div> | ... | ... |