Commit 74dcb9ee28782896231536757d6a0c57bf921547
1 parent
b98e94c9
add variantSku
Showing
7 changed files
with
370 additions
and
370 deletions
Show diff stats
controllers/SeoController.php
1 | -<?php | ||
2 | - | ||
3 | -namespace artweb\artbox\seo\controllers; | ||
4 | - | ||
5 | -use Yii; | ||
6 | -use artweb\artbox\seo\models\Seo; | ||
7 | -use artweb\artbox\seo\models\SeoSearch; | ||
8 | -use yii\web\Controller; | ||
9 | -use yii\web\NotFoundHttpException; | ||
10 | -use yii\filters\VerbFilter; | ||
11 | -use developeruz\db_rbac\behaviors\AccessBehavior; | ||
12 | -/** | ||
13 | - * SeoController implements the CRUD actions for Seo model. | ||
14 | - */ | ||
15 | -class SeoController extends Controller | ||
16 | -{ | ||
17 | - /** | ||
18 | - * @inheritdoc | ||
19 | - */ | ||
20 | - public function behaviors() | ||
21 | - { | ||
22 | - return [ | ||
23 | - 'access'=>[ | ||
24 | - 'class' => AccessBehavior::className(), | ||
25 | - 'rules' => | ||
26 | - ['site' => | ||
27 | - [ | ||
28 | - [ | ||
29 | - 'actions' => ['login', 'error'], | ||
30 | - 'allow' => true, | ||
31 | - ] | ||
32 | - ] | ||
33 | - ] | ||
34 | - ], | ||
35 | - 'verbs' => [ | ||
36 | - 'class' => VerbFilter::className(), | ||
37 | - | ||
38 | - ], | ||
39 | - ]; | ||
40 | - } | ||
41 | - | ||
42 | - /** | ||
43 | - * Lists all Seo models. | ||
44 | - * @return mixed | ||
45 | - */ | ||
46 | - public function actionIndex() | ||
47 | - { | ||
48 | - $searchModel = new SeoSearch(); | ||
49 | - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | ||
50 | - | ||
51 | - return $this->render('index', [ | ||
52 | - 'searchModel' => $searchModel, | ||
53 | - 'dataProvider' => $dataProvider, | ||
54 | - ]); | ||
55 | - } | ||
56 | - | ||
57 | - /** | ||
58 | - * Displays a single Seo model. | ||
59 | - * @param integer $id | ||
60 | - * @return mixed | ||
61 | - */ | ||
62 | - public function actionView($id) | ||
63 | - { | ||
64 | - return $this->render('view', [ | ||
65 | - 'model' => $this->findModel($id), | ||
66 | - ]); | ||
67 | - } | ||
68 | - | ||
69 | - /** | ||
70 | - * Creates a new Seo model. | ||
71 | - * If creation is successful, the browser will be redirected to the 'view' page. | ||
72 | - * @return mixed | ||
73 | - */ | ||
74 | - public function actionCreate() | ||
75 | - { | ||
76 | - $model = new Seo(); | ||
77 | - | ||
78 | - if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
79 | - return $this->redirect(['view', 'id' => $model->id]); | ||
80 | - } else { | ||
81 | - return $this->render('create', [ | ||
82 | - 'model' => $model, | ||
83 | - ]); | ||
84 | - } | ||
85 | - } | ||
86 | - | ||
87 | - /** | ||
88 | - * Updates an existing Seo model. | ||
89 | - * If update is successful, the browser will be redirected to the 'view' page. | ||
90 | - * @param integer $id | ||
91 | - * @return mixed | ||
92 | - */ | ||
93 | - public function actionUpdate($id) | ||
94 | - { | ||
95 | - $model = $this->findModel($id); | ||
96 | - | ||
97 | - if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
98 | - return $this->redirect(['view', 'id' => $model->id]); | ||
99 | - } else { | ||
100 | - return $this->render('update', [ | ||
101 | - 'model' => $model, | ||
102 | - ]); | ||
103 | - } | ||
104 | - } | ||
105 | - | ||
106 | - /** | ||
107 | - * Deletes an existing Seo model. | ||
108 | - * If deletion is successful, the browser will be redirected to the 'index' page. | ||
109 | - * @param integer $id | ||
110 | - * @return mixed | ||
111 | - */ | ||
112 | - public function actionDelete($id) | ||
113 | - { | ||
114 | - $this->findModel($id)->delete(); | ||
115 | - | ||
116 | - return $this->redirect(['index']); | ||
117 | - } | ||
118 | - | ||
119 | - /** | ||
120 | - * Finds the Seo model based on its primary key value. | ||
121 | - * If the model is not found, a 404 HTTP exception will be thrown. | ||
122 | - * @param integer $id | ||
123 | - * @return Seo the loaded model | ||
124 | - * @throws NotFoundHttpException if the model cannot be found | ||
125 | - */ | ||
126 | - protected function findModel($id) | ||
127 | - { | ||
128 | - if (($model = Seo::findOne($id)) !== null) { | ||
129 | - return $model; | ||
130 | - } else { | ||
131 | - throw new NotFoundHttpException('The requested page does not exist.'); | ||
132 | - } | ||
133 | - } | ||
134 | -} | 1 | +<?php |
2 | + | ||
3 | +namespace artweb\artbox\seo\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use artweb\artbox\seo\models\Seo; | ||
7 | +use artweb\artbox\seo\models\SeoSearch; | ||
8 | +use yii\web\Controller; | ||
9 | +use yii\web\NotFoundHttpException; | ||
10 | +use yii\filters\VerbFilter; | ||
11 | +use developeruz\db_rbac\behaviors\AccessBehavior; | ||
12 | +/** | ||
13 | + * SeoController implements the CRUD actions for Seo model. | ||
14 | + */ | ||
15 | +class SeoController extends Controller | ||
16 | +{ | ||
17 | + /** | ||
18 | + * @inheritdoc | ||
19 | + */ | ||
20 | + public function behaviors() | ||
21 | + { | ||
22 | + return [ | ||
23 | + 'access'=>[ | ||
24 | + 'class' => AccessBehavior::className(), | ||
25 | + 'rules' => | ||
26 | + ['site' => | ||
27 | + [ | ||
28 | + [ | ||
29 | + 'actions' => ['login', 'error'], | ||
30 | + 'allow' => true, | ||
31 | + ] | ||
32 | + ] | ||
33 | + ] | ||
34 | + ], | ||
35 | + 'verbs' => [ | ||
36 | + 'class' => VerbFilter::className(), | ||
37 | + | ||
38 | + ], | ||
39 | + ]; | ||
40 | + } | ||
41 | + | ||
42 | + /** | ||
43 | + * Lists all Seo models. | ||
44 | + * @return mixed | ||
45 | + */ | ||
46 | + public function actionIndex() | ||
47 | + { | ||
48 | + $searchModel = new SeoSearch(); | ||
49 | + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | ||
50 | + | ||
51 | + return $this->render('index', [ | ||
52 | + 'searchModel' => $searchModel, | ||
53 | + 'dataProvider' => $dataProvider, | ||
54 | + ]); | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * Displays a single Seo model. | ||
59 | + * @param integer $id | ||
60 | + * @return mixed | ||
61 | + */ | ||
62 | + public function actionView($id) | ||
63 | + { | ||
64 | + return $this->render('view', [ | ||
65 | + 'model' => $this->findModel($id), | ||
66 | + ]); | ||
67 | + } | ||
68 | + | ||
69 | + /** | ||
70 | + * Creates a new Seo model. | ||
71 | + * If creation is successful, the browser will be redirected to the 'view' page. | ||
72 | + * @return mixed | ||
73 | + */ | ||
74 | + public function actionCreate() | ||
75 | + { | ||
76 | + $model = new Seo(); | ||
77 | + | ||
78 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
79 | + return $this->redirect(['view', 'id' => $model->id]); | ||
80 | + } else { | ||
81 | + return $this->render('create', [ | ||
82 | + 'model' => $model, | ||
83 | + ]); | ||
84 | + } | ||
85 | + } | ||
86 | + | ||
87 | + /** | ||
88 | + * Updates an existing Seo model. | ||
89 | + * If update is successful, the browser will be redirected to the 'view' page. | ||
90 | + * @param integer $id | ||
91 | + * @return mixed | ||
92 | + */ | ||
93 | + public function actionUpdate($id) | ||
94 | + { | ||
95 | + $model = $this->findModel($id); | ||
96 | + | ||
97 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
98 | + return $this->redirect(['view', 'id' => $model->id]); | ||
99 | + } else { | ||
100 | + return $this->render('update', [ | ||
101 | + 'model' => $model, | ||
102 | + ]); | ||
103 | + } | ||
104 | + } | ||
105 | + | ||
106 | + /** | ||
107 | + * Deletes an existing Seo model. | ||
108 | + * If deletion is successful, the browser will be redirected to the 'index' page. | ||
109 | + * @param integer $id | ||
110 | + * @return mixed | ||
111 | + */ | ||
112 | + public function actionDelete($id) | ||
113 | + { | ||
114 | + $this->findModel($id)->delete(); | ||
115 | + | ||
116 | + return $this->redirect(['index']); | ||
117 | + } | ||
118 | + | ||
119 | + /** | ||
120 | + * Finds the Seo model based on its primary key value. | ||
121 | + * If the model is not found, a 404 HTTP exception will be thrown. | ||
122 | + * @param integer $id | ||
123 | + * @return Seo the loaded model | ||
124 | + * @throws NotFoundHttpException if the model cannot be found | ||
125 | + */ | ||
126 | + protected function findModel($id) | ||
127 | + { | ||
128 | + if (($model = Seo::findOne($id)) !== null) { | ||
129 | + return $model; | ||
130 | + } else { | ||
131 | + throw new NotFoundHttpException('The requested page does not exist.'); | ||
132 | + } | ||
133 | + } | ||
134 | +} |
models/SeoSearch.php
1 | -<?php | ||
2 | - | ||
3 | -namespace artweb\artbox\seo\models; | ||
4 | - | ||
5 | -use Yii; | ||
6 | -use yii\base\Model; | ||
7 | -use yii\data\ActiveDataProvider; | ||
8 | -use artweb\artbox\seo\models\Seo; | ||
9 | - | ||
10 | -/** | ||
11 | - * SeoSearch represents the model behind the search form about `common\models\Seo`. | ||
12 | - */ | ||
13 | -class SeoSearch extends Seo | ||
14 | -{ | ||
15 | - /** | ||
16 | - * @inheritdoc | ||
17 | - */ | ||
18 | - public function rules() | ||
19 | - { | ||
20 | - return [ | ||
21 | - [['id'], 'integer'], | ||
22 | - [['url', 'title', 'meta', 'description', 'h1', 'seo_text'], 'safe'], | ||
23 | - ]; | ||
24 | - } | ||
25 | - | ||
26 | - /** | ||
27 | - * @inheritdoc | ||
28 | - */ | ||
29 | - public function scenarios() | ||
30 | - { | ||
31 | - // bypass scenarios() implementation in the parent class | ||
32 | - return Model::scenarios(); | ||
33 | - } | ||
34 | - | ||
35 | - /** | ||
36 | - * Creates data provider instance with search query applied | ||
37 | - * | ||
38 | - * @param array $params | ||
39 | - * | ||
40 | - * @return ActiveDataProvider | ||
41 | - */ | ||
42 | - public function search($params) | ||
43 | - { | ||
44 | - $query = Seo::find(); | ||
45 | - | ||
46 | - // add conditions that should always apply here | ||
47 | - | ||
48 | - $dataProvider = new ActiveDataProvider([ | ||
49 | - 'query' => $query, | ||
50 | - ]); | ||
51 | - | ||
52 | - $this->load($params); | ||
53 | - | ||
54 | - if (!$this->validate()) { | ||
55 | - // uncomment the following line if you do not want to return any records when validation fails | ||
56 | - // $query->where('0=1'); | ||
57 | - return $dataProvider; | ||
58 | - } | ||
59 | - | ||
60 | - // grid filtering conditions | ||
61 | - $query->andFilterWhere([ | ||
62 | - 'id' => $this->id, | ||
63 | - ]); | ||
64 | - | ||
65 | - $query->andFilterWhere(['like', 'url', $this->url]) | ||
66 | - ->andFilterWhere(['like', 'title', $this->title]) | ||
67 | - ->andFilterWhere(['like', 'meta', $this->meta]) | ||
68 | - ->andFilterWhere(['like', 'description', $this->description]) | ||
69 | - ->andFilterWhere(['like', 'h1', $this->h1]) | ||
70 | - ->andFilterWhere(['like', 'seo_text', $this->seo_text]); | ||
71 | - | ||
72 | - return $dataProvider; | ||
73 | - } | ||
74 | -} | 1 | +<?php |
2 | + | ||
3 | +namespace artweb\artbox\seo\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use yii\base\Model; | ||
7 | +use yii\data\ActiveDataProvider; | ||
8 | +use artweb\artbox\seo\models\Seo; | ||
9 | + | ||
10 | +/** | ||
11 | + * SeoSearch represents the model behind the search form about `common\models\Seo`. | ||
12 | + */ | ||
13 | +class SeoSearch extends Seo | ||
14 | +{ | ||
15 | + /** | ||
16 | + * @inheritdoc | ||
17 | + */ | ||
18 | + public function rules() | ||
19 | + { | ||
20 | + return [ | ||
21 | + [['id'], 'integer'], | ||
22 | + [['url', 'title', 'meta', 'description', 'h1', 'seo_text'], 'safe'], | ||
23 | + ]; | ||
24 | + } | ||
25 | + | ||
26 | + /** | ||
27 | + * @inheritdoc | ||
28 | + */ | ||
29 | + public function scenarios() | ||
30 | + { | ||
31 | + // bypass scenarios() implementation in the parent class | ||
32 | + return Model::scenarios(); | ||
33 | + } | ||
34 | + | ||
35 | + /** | ||
36 | + * Creates data provider instance with search query applied | ||
37 | + * | ||
38 | + * @param array $params | ||
39 | + * | ||
40 | + * @return ActiveDataProvider | ||
41 | + */ | ||
42 | + public function search($params) | ||
43 | + { | ||
44 | + $query = Seo::find(); | ||
45 | + | ||
46 | + // add conditions that should always apply here | ||
47 | + | ||
48 | + $dataProvider = new ActiveDataProvider([ | ||
49 | + 'query' => $query, | ||
50 | + ]); | ||
51 | + | ||
52 | + $this->load($params); | ||
53 | + | ||
54 | + if (!$this->validate()) { | ||
55 | + // uncomment the following line if you do not want to return any records when validation fails | ||
56 | + // $query->where('0=1'); | ||
57 | + return $dataProvider; | ||
58 | + } | ||
59 | + | ||
60 | + // grid filtering conditions | ||
61 | + $query->andFilterWhere([ | ||
62 | + 'id' => $this->id, | ||
63 | + ]); | ||
64 | + | ||
65 | + $query->andFilterWhere(['like', 'url', $this->url]) | ||
66 | + ->andFilterWhere(['like', 'title', $this->title]) | ||
67 | + ->andFilterWhere(['like', 'meta', $this->meta]) | ||
68 | + ->andFilterWhere(['like', 'description', $this->description]) | ||
69 | + ->andFilterWhere(['like', 'h1', $this->h1]) | ||
70 | + ->andFilterWhere(['like', 'seo_text', $this->seo_text]); | ||
71 | + | ||
72 | + return $dataProvider; | ||
73 | + } | ||
74 | +} |
views/seo/_form.php
1 | -<?php | ||
2 | - | ||
3 | -use yii\helpers\Html; | ||
4 | -use yii\widgets\ActiveForm; | ||
5 | -use mihaildev\ckeditor\CKEditor; | ||
6 | -use mihaildev\elfinder\ElFinder; | ||
7 | -/* @var $this yii\web\View */ | ||
8 | -/* @var $model common\models\Seo */ | ||
9 | -/* @var $form yii\widgets\ActiveForm */ | ||
10 | -?> | ||
11 | - | ||
12 | -<div class="seo-form"> | ||
13 | - | ||
14 | - <?php $form = ActiveForm::begin(); ?> | ||
15 | - | ||
16 | - <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?> | ||
17 | - | ||
18 | - <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> | ||
19 | - | ||
20 | - <?= $form->field($model, 'meta')->textInput(['maxlength' => true]) ?> | ||
21 | - | ||
22 | - <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?> | ||
23 | - | ||
24 | - <?= $form->field($model, 'h1')->textInput(['maxlength' => true]) ?> | ||
25 | - <?= $form->field($model, 'seo_text')->widget(CKEditor::className(), | ||
26 | - [ | ||
27 | - 'editorOptions' => ElFinder::ckeditorOptions('elfinder',[ | ||
28 | - 'preset' => 'full', //ัะฐะทัะฐะฑะพัะฐะฝะฝั ััะฐะฝะดะฐััะฝัะต ะฝะฐัััะพะนะบะธ basic, standard, full ะดะฐะฝะฝัั ะฒะพะทะผะพะถะฝะพััั ะฝะต ะพะฑัะทะฐัะตะปัะฝะพ ะธัะฟะพะปัะทะพะฒะฐัั | ||
29 | - 'inline' => false, //ะฟะพ ัะผะพะปัะฐะฝะธั false]), | ||
30 | - 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('file/uploader/images-upload') | ||
31 | - ] | ||
32 | - ) | ||
33 | - ]) ?> | ||
34 | - | ||
35 | - <div class="form-group"> | ||
36 | - <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
37 | - </div> | ||
38 | - | ||
39 | - <?php ActiveForm::end(); ?> | ||
40 | - | ||
41 | -</div> | 1 | +<?php |
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\ActiveForm; | ||
5 | +use mihaildev\ckeditor\CKEditor; | ||
6 | +use mihaildev\elfinder\ElFinder; | ||
7 | +/* @var $this yii\web\View */ | ||
8 | +/* @var $model common\models\Seo */ | ||
9 | +/* @var $form yii\widgets\ActiveForm */ | ||
10 | +?> | ||
11 | + | ||
12 | +<div class="seo-form"> | ||
13 | + | ||
14 | + <?php $form = ActiveForm::begin(); ?> | ||
15 | + | ||
16 | + <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?> | ||
17 | + | ||
18 | + <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> | ||
19 | + | ||
20 | + <?= $form->field($model, 'meta')->textInput(['maxlength' => true]) ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'h1')->textInput(['maxlength' => true]) ?> | ||
25 | + <?= $form->field($model, 'seo_text')->widget(CKEditor::className(), | ||
26 | + [ | ||
27 | + 'editorOptions' => ElFinder::ckeditorOptions('elfinder',[ | ||
28 | + 'preset' => 'full', //ัะฐะทัะฐะฑะพัะฐะฝะฝั ััะฐะฝะดะฐััะฝัะต ะฝะฐัััะพะนะบะธ basic, standard, full ะดะฐะฝะฝัั ะฒะพะทะผะพะถะฝะพััั ะฝะต ะพะฑัะทะฐัะตะปัะฝะพ ะธัะฟะพะปัะทะพะฒะฐัั | ||
29 | + 'inline' => false, //ะฟะพ ัะผะพะปัะฐะฝะธั false]), | ||
30 | + 'filebrowserUploadUrl'=>Yii::$app->getUrlManager()->createUrl('file/uploader/images-upload') | ||
31 | + ] | ||
32 | + ) | ||
33 | + ]) ?> | ||
34 | + | ||
35 | + <div class="form-group"> | ||
36 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
37 | + </div> | ||
38 | + | ||
39 | + <?php ActiveForm::end(); ?> | ||
40 | + | ||
41 | +</div> |
views/seo/create.php
1 | -<?php | ||
2 | - | ||
3 | -use yii\helpers\Html; | ||
4 | - | ||
5 | - | ||
6 | -/* @var $this yii\web\View */ | ||
7 | -/* @var $model common\models\Seo */ | ||
8 | - | ||
9 | -$this->title = Yii::t('app', 'Create Seo'); | ||
10 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | ||
11 | -$this->params['breadcrumbs'][] = $this->title; | ||
12 | -?> | ||
13 | -<div class="seo-create"> | ||
14 | - | ||
15 | - <h1><?= Html::encode($this->title) ?></h1> | ||
16 | - | ||
17 | - <?= $this->render('_form', [ | ||
18 | - 'model' => $model, | ||
19 | - ]) ?> | ||
20 | - | ||
21 | -</div> | 1 | +<?php |
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model common\models\Seo */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Create Seo'); | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="seo-create"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <?= $this->render('_form', [ | ||
18 | + 'model' => $model, | ||
19 | + ]) ?> | ||
20 | + | ||
21 | +</div> |
views/seo/index.php
1 | -<?php | ||
2 | - | ||
3 | -use yii\helpers\Html; | ||
4 | -use yii\grid\GridView; | ||
5 | - | ||
6 | -/* @var $this yii\web\View */ | ||
7 | -/* @var $searchModel common\models\SeoSearch */ | ||
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
9 | - | ||
10 | -$this->title = Yii::t('app', 'Seo'); | ||
11 | -$this->params['breadcrumbs'][] = $this->title; | ||
12 | -?> | ||
13 | -<div class="seo-index"> | ||
14 | - | ||
15 | - <h1><?= Html::encode($this->title) ?></h1> | ||
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | ||
17 | - | ||
18 | - <p> | ||
19 | - <?= Html::a(Yii::t('app', 'Create Seo'), ['create'], ['class' => 'btn btn-success']) ?> | ||
20 | - </p> | ||
21 | - <?= GridView::widget([ | ||
22 | - 'dataProvider' => $dataProvider, | ||
23 | - 'filterModel' => $searchModel, | ||
24 | - 'columns' => [ | ||
25 | - ['class' => 'yii\grid\SerialColumn'], | ||
26 | - | ||
27 | - 'id', | ||
28 | - 'url:url', | ||
29 | - 'meta', | ||
30 | - 'h1', | ||
31 | - // 'seo_text:ntext', | ||
32 | - | ||
33 | - ['class' => 'yii\grid\ActionColumn'], | ||
34 | - ], | ||
35 | - ]); ?> | ||
36 | -</div> | 1 | +<?php |
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\grid\GridView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $searchModel common\models\SeoSearch */ | ||
8 | +/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
9 | + | ||
10 | +$this->title = Yii::t('app', 'Seo'); | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="seo-index"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | ||
17 | + | ||
18 | + <p> | ||
19 | + <?= Html::a(Yii::t('app', 'Create Seo'), ['create'], ['class' => 'btn btn-success']) ?> | ||
20 | + </p> | ||
21 | + <?= GridView::widget([ | ||
22 | + 'dataProvider' => $dataProvider, | ||
23 | + 'filterModel' => $searchModel, | ||
24 | + 'columns' => [ | ||
25 | + ['class' => 'yii\grid\SerialColumn'], | ||
26 | + | ||
27 | + 'id', | ||
28 | + 'url:url', | ||
29 | + 'meta', | ||
30 | + 'h1', | ||
31 | + // 'seo_text:ntext', | ||
32 | + | ||
33 | + ['class' => 'yii\grid\ActionColumn'], | ||
34 | + ], | ||
35 | + ]); ?> | ||
36 | +</div> |
views/seo/update.php
1 | -<?php | ||
2 | - | ||
3 | -use yii\helpers\Html; | ||
4 | - | ||
5 | -/* @var $this yii\web\View */ | ||
6 | -/* @var $model artweb\artbox\seo\models\Seo */ | ||
7 | - | ||
8 | -$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | - 'modelClass' => 'Seo', | ||
10 | -]) . $model->title; | ||
11 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | ||
12 | -$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]]; | ||
13 | -$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | -?> | ||
15 | -<div class="seo-update"> | ||
16 | - | ||
17 | - <h1><?= Html::encode($this->title) ?></h1> | ||
18 | - | ||
19 | - <?= $this->render('_form', [ | ||
20 | - 'model' => $model, | ||
21 | - ]) ?> | ||
22 | - | ||
23 | -</div> | 1 | +<?php |
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $model artweb\artbox\seo\models\Seo */ | ||
7 | + | ||
8 | +$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | + 'modelClass' => 'Seo', | ||
10 | +]) . $model->title; | ||
11 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | ||
12 | +$this->params['breadcrumbs'][] = ['label' => $model->title, 'url' => ['view', 'id' => $model->id]]; | ||
13 | +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | +?> | ||
15 | +<div class="seo-update"> | ||
16 | + | ||
17 | + <h1><?= Html::encode($this->title) ?></h1> | ||
18 | + | ||
19 | + <?= $this->render('_form', [ | ||
20 | + 'model' => $model, | ||
21 | + ]) ?> | ||
22 | + | ||
23 | +</div> |
views/seo/view.php
1 | -<?php | ||
2 | - | ||
3 | -use yii\helpers\Html; | ||
4 | -use yii\widgets\DetailView; | ||
5 | - | ||
6 | -/* @var $this yii\web\View */ | ||
7 | -/* @var $model artweb\artbox\seo\models\Seo */ | ||
8 | - | ||
9 | -$this->title = $model->title; | ||
10 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | ||
11 | -$this->params['breadcrumbs'][] = $this->title; | ||
12 | -?> | ||
13 | -<div class="seo-view"> | ||
14 | - | ||
15 | - <h1><?= Html::encode($this->title) ?></h1> | ||
16 | - | ||
17 | - <p> | ||
18 | - <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | - <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | - 'class' => 'btn btn-danger', | ||
21 | - 'data' => [ | ||
22 | - 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | ||
23 | - 'method' => 'post', | ||
24 | - ], | ||
25 | - ]) ?> | ||
26 | - </p> | ||
27 | - | ||
28 | - <?= DetailView::widget([ | ||
29 | - 'model' => $model, | ||
30 | - 'attributes' => [ | ||
31 | - 'id', | ||
32 | - 'url:url', | ||
33 | - 'title', | ||
34 | - 'meta', | ||
35 | - 'description', | ||
36 | - 'h1', | ||
37 | - 'seo_text:ntext', | ||
38 | - ], | ||
39 | - ]) ?> | ||
40 | - | ||
41 | -</div> | 1 | +<?php |
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\DetailView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model artweb\artbox\seo\models\Seo */ | ||
8 | + | ||
9 | +$this->title = $model->title; | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="seo-view"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | + 'class' => 'btn btn-danger', | ||
21 | + 'data' => [ | ||
22 | + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | ||
23 | + 'method' => 'post', | ||
24 | + ], | ||
25 | + ]) ?> | ||
26 | + </p> | ||
27 | + | ||
28 | + <?= DetailView::widget([ | ||
29 | + 'model' => $model, | ||
30 | + 'attributes' => [ | ||
31 | + 'id', | ||
32 | + 'url:url', | ||
33 | + 'title', | ||
34 | + 'meta', | ||
35 | + 'description', | ||
36 | + 'h1', | ||
37 | + 'seo_text:ntext', | ||
38 | + ], | ||
39 | + ]) ?> | ||
40 | + | ||
41 | +</div> |