diff --git a/backend/config/test-local.php b/backend/config/test-local.php old mode 100644 new mode 100755 index 4513a34..4513a34 --- a/backend/config/test-local.php +++ b/backend/config/test-local.php diff --git a/backend/views/layouts/main-sidebar.php b/backend/views/layouts/main-sidebar.php index 15e30c7..0bb4414 100755 --- a/backend/views/layouts/main-sidebar.php +++ b/backend/views/layouts/main-sidebar.php @@ -121,6 +121,29 @@ use yii\widgets\Menu; 'options' => ['class'=>\Yii::$app->user->can('article') ? '' :'hide'], ], [ + 'label' => 'Блог', + 'template'=>' {label}', + 'options' => ['class'=>\Yii::$app->user->can('blog') ? '' :'hide'], + 'active' => preg_match('/^blog.*$/', $this->context->id) ? true : false, + 'items' => [ + [ + 'label' => 'Статьи', + 'url' => ['/blog/blog-article'], + 'options' => ['class'=>\Yii::$app->user->can('blog') ? '' :'hide'], + ], + [ + 'label' => 'Рубрики', + 'url' => ['/blog/blog-category'], + 'options' => ['class'=>\Yii::$app->user->can('blog') ? '' :'hide'], + ], + [ + 'label' => 'Тэги', + 'url' => ['/blog/blog-tag'], + 'options' => ['class'=>\Yii::$app->user->can('blog') ? '' :'hide'], + ], + ] + ], + [ 'label' => 'Акции', 'template'=>' {label}', 'url' => ['/event/index'], diff --git a/backup_leha.sql b/backup_leha.sql old mode 100644 new mode 100755 index 503d395..503d395 --- a/backup_leha.sql +++ b/backup_leha.sql diff --git a/common/config/main.php b/common/config/main.php index e608240..a420928 100755 --- a/common/config/main.php +++ b/common/config/main.php @@ -53,5 +53,8 @@ 'artbox-comment' => [ 'class' => 'common\modules\comment\Module', ], + 'blog' => [ + 'class' => 'common\modules\blog\Module' + ], ], ]; diff --git a/common/config/test-local.php b/common/config/test-local.php old mode 100644 new mode 100755 index b30e64b..b30e64b --- a/common/config/test-local.php +++ b/common/config/test-local.php diff --git a/common/modules/blog/Module.php b/common/modules/blog/Module.php new file mode 100644 index 0000000..cd85726 --- /dev/null +++ b/common/modules/blog/Module.php @@ -0,0 +1,24 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => ['POST'], + ], + ], + ]; + } + + /** + * Lists all BlogArticle models. + * @return mixed + */ + public function actionIndex() + { + $searchModel = new BlogArticleSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single BlogArticle model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new BlogArticle model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new BlogArticle(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing BlogArticle model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing BlogArticle model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the BlogArticle model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return BlogArticle the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = BlogArticle::findOne($id)) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } +} diff --git a/common/modules/blog/controllers/BlogCategoryController.php b/common/modules/blog/controllers/BlogCategoryController.php new file mode 100644 index 0000000..c1cddee --- /dev/null +++ b/common/modules/blog/controllers/BlogCategoryController.php @@ -0,0 +1,124 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => ['POST'], + ], + ], + ]; + } + + /** + * Lists all BlogCategory models. + * @return mixed + */ + public function actionIndex() + { + $searchModel = new BlogCategorySearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single BlogCategory model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new BlogCategory model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new BlogCategory(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing BlogCategory model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing BlogCategory model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the BlogCategory model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return BlogCategory the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = BlogCategory::findOne($id)) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } +} diff --git a/common/modules/blog/controllers/BlogTagController.php b/common/modules/blog/controllers/BlogTagController.php new file mode 100644 index 0000000..48020a0 --- /dev/null +++ b/common/modules/blog/controllers/BlogTagController.php @@ -0,0 +1,124 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => ['POST'], + ], + ], + ]; + } + + /** + * Lists all BlogTag models. + * @return mixed + */ + public function actionIndex() + { + $searchModel = new BlogTagSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single BlogTag model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new BlogTag model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new BlogTag(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing BlogTag model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing BlogTag model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the BlogTag model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return BlogTag the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = BlogTag::findOne($id)) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } +} diff --git a/common/modules/blog/controllers/DefaultController.php b/common/modules/blog/controllers/DefaultController.php new file mode 100644 index 0000000..7cad6b8 --- /dev/null +++ b/common/modules/blog/controllers/DefaultController.php @@ -0,0 +1,20 @@ +render('index'); + } +} diff --git a/common/modules/blog/models/BlogArticle.php b/common/modules/blog/models/BlogArticle.php new file mode 100644 index 0000000..4a5b2be --- /dev/null +++ b/common/modules/blog/models/BlogArticle.php @@ -0,0 +1,196 @@ + [ + 'class' => LanguageBehavior::className(), + ], + ]; + } + /** + * @inheritdoc + */ + public function rules() + { + return [ + [ + [ + 'created_at', + 'updated_at', + 'deleted_at', + 'sort', + 'author_id', + ], + 'integer', + ], + [ + [ 'status' ], + 'boolean', + ], + [ + [ 'image' ], + 'string', + 'max' => 255, + ], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'image' => 'Image', + 'created_at' => 'Created At', + 'updated_at' => 'Updated At', + 'deleted_at' => 'Deleted At', + 'sort' => 'Sort', + 'status' => 'Status', + 'author_id' => 'Author ID', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleLangs() + { + return $this->hasMany(BlogArticleLang::className(), [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguages() + { + return $this->hasMany(Language::className(), [ 'id' => 'language_id' ]) + ->viaTable('blog_article_lang', [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToArticles() + { + return $this->hasMany(BlogArticleToArticle::className(), [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToArticles0() + { + return $this->hasMany(BlogArticleToArticle::className(), [ 'related_blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getRelatedBlogArticles() + { + return $this->hasMany(BlogArticle::className(), [ 'id' => 'related_blog_article_id' ]) + ->viaTable('blog_article_to_article', [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticles() + { + return $this->hasMany(BlogArticle::className(), [ 'id' => 'blog_article_id' ]) + ->viaTable('blog_article_to_article', [ 'related_blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToCategories() + { + return $this->hasMany(BlogArticleToCategory::className(), [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogCategories() + { + return $this->hasMany(BlogCategory::className(), [ 'id' => 'blog_category_id' ]) + ->viaTable('blog_article_to_category', [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToProducts() + { + return $this->hasMany(BlogArticleToProduct::className(), [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getProducts() + { + return $this->hasMany(Product::className(), [ 'id' => 'product_id' ]) + ->viaTable('blog_article_to_product', [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToTags() + { + return $this->hasMany(BlogArticleToTag::className(), [ 'blog_article_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogTags() + { + return $this->hasMany(BlogTag::className(), [ 'id' => 'blog_tag_id' ]) + ->viaTable('blog_article_to_tag', [ 'blog_article_id' => 'id' ]); + } + } diff --git a/common/modules/blog/models/BlogArticleLang.php b/common/modules/blog/models/BlogArticleLang.php new file mode 100644 index 0000000..f366f0e --- /dev/null +++ b/common/modules/blog/models/BlogArticleLang.php @@ -0,0 +1,88 @@ + 255], + [['alias'], 'unique'], + [['blog_article_id', 'language_id'], 'unique', 'targetAttribute' => ['blog_article_id', 'language_id'], 'message' => 'The combination of Blog Article ID and Language ID has already been taken.'], + [['blog_article_id'], 'exist', 'skipOnError' => true, 'targetClass' => BlogArticle::className(), 'targetAttribute' => ['blog_article_id' => 'id']], + [['language_id'], 'exist', 'skipOnError' => true, 'targetClass' => Language::className(), 'targetAttribute' => ['language_id' => 'id']], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'blog_article_id' => 'Blog Article ID', + 'language_id' => 'Language ID', + 'title' => 'Title', + 'body' => 'Body', + 'body_preview' => 'Body Preview', + 'alias' => 'Alias', + 'meta_title' => 'Meta Title', + 'meta_description' => 'Meta Description', + 'h1' => 'H1', + 'seo_text' => 'Seo Text', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticle() + { + return $this->hasOne(BlogArticle::className(), ['id' => 'blog_article_id']); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguage() + { + return $this->hasOne(Language::className(), ['id' => 'language_id']); + } +} diff --git a/common/modules/blog/models/BlogArticleSearch.php b/common/modules/blog/models/BlogArticleSearch.php new file mode 100644 index 0000000..1cb352e --- /dev/null +++ b/common/modules/blog/models/BlogArticleSearch.php @@ -0,0 +1,84 @@ + $query, + ]); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere([ + 'id' => $this->id, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + 'deleted_at' => $this->deleted_at, + 'sort' => $this->sort, + 'status' => $this->status, + 'author_id' => $this->author_id, + ]); + + $query->andFilterWhere(['like', 'image', $this->image]); + + return $dataProvider; + } +} diff --git a/common/modules/blog/models/BlogCategory.php b/common/modules/blog/models/BlogCategory.php new file mode 100644 index 0000000..7b2dfa1 --- /dev/null +++ b/common/modules/blog/models/BlogCategory.php @@ -0,0 +1,115 @@ + [ + 'class' => LanguageBehavior::className(), + ], + ]; + } + + /** + * @inheritdoc + */ + public function rules() + { + return [ + [ + [ + 'sort', + 'parent_id', + ], + 'integer', + ], + [ + [ 'status' ], + 'boolean', + ], + [ + [ 'image' ], + 'string', + 'max' => 255, + ], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'sort' => 'Sort', + 'image' => 'Image', + 'parent_id' => 'Parent ID', + 'status' => 'Status', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToCategories() + { + return $this->hasMany(BlogArticleToCategory::className(), [ 'blog_category_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticles() + { + return $this->hasMany(BlogArticle::className(), [ 'id' => 'blog_article_id' ]) + ->viaTable('blog_article_to_category', [ 'blog_category_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogCategoryLangs() + { + return $this->hasMany(BlogCategoryLang::className(), [ 'blog_category_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguages() + { + return $this->hasMany(Language::className(), [ 'id' => 'language_id' ]) + ->viaTable('blog_category_lang', [ 'blog_category_id' => 'id' ]); + } + } diff --git a/common/modules/blog/models/BlogCategoryLang.php b/common/modules/blog/models/BlogCategoryLang.php new file mode 100644 index 0000000..0bf559a --- /dev/null +++ b/common/modules/blog/models/BlogCategoryLang.php @@ -0,0 +1,85 @@ + 255], + [['alias'], 'unique'], + [['blog_category_id', 'language_id'], 'unique', 'targetAttribute' => ['blog_category_id', 'language_id'], 'message' => 'The combination of Blog Category ID and Language ID has already been taken.'], + [['blog_category_id'], 'exist', 'skipOnError' => true, 'targetClass' => BlogCategory::className(), 'targetAttribute' => ['blog_category_id' => 'id']], + [['language_id'], 'exist', 'skipOnError' => true, 'targetClass' => Language::className(), 'targetAttribute' => ['language_id' => 'id']], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'blog_category_id' => 'Blog Category ID', + 'language_id' => 'Language ID', + 'title' => 'Title', + 'alias' => 'Alias', + 'description' => 'Description', + 'meta_title' => 'Meta Title', + 'meta_description' => 'Meta Description', + 'h1' => 'H1', + 'seo_text' => 'Seo Text', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogCategory() + { + return $this->hasOne(BlogCategory::className(), ['id' => 'blog_category_id']); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguage() + { + return $this->hasOne(Language::className(), ['id' => 'language_id']); + } +} diff --git a/common/modules/blog/models/BlogCategorySearch.php b/common/modules/blog/models/BlogCategorySearch.php new file mode 100644 index 0000000..a674c7a --- /dev/null +++ b/common/modules/blog/models/BlogCategorySearch.php @@ -0,0 +1,81 @@ + $query, + ]); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere([ + 'id' => $this->id, + 'sort' => $this->sort, + 'parent_id' => $this->parent_id, + 'status' => $this->status, + ]); + + $query->andFilterWhere(['like', 'image', $this->image]); + + return $dataProvider; + } +} diff --git a/common/modules/blog/models/BlogTag.php b/common/modules/blog/models/BlogTag.php new file mode 100644 index 0000000..6a3a0be --- /dev/null +++ b/common/modules/blog/models/BlogTag.php @@ -0,0 +1,95 @@ + [ + 'class' => LanguageBehavior::className(), + ], + ]; + } + + /** + * @inheritdoc + */ + public function rules() + { + return [ + [ + [ 'id' ], + 'integer', + ], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticleToTags() + { + return $this->hasMany(BlogArticleToTag::className(), [ 'blog_tag_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogArticles() + { + return $this->hasMany(BlogArticle::className(), [ 'id' => 'blog_article_id' ]) + ->viaTable('blog_article_to_tag', [ 'blog_tag_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogTagLangs() + { + return $this->hasMany(BlogTagLang::className(), [ 'blog_tag_id' => 'id' ]); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguages() + { + return $this->hasMany(Language::className(), [ 'id' => 'language_id' ]) + ->viaTable('blog_tag_lang', [ 'blog_tag_id' => 'id' ]); + } + } diff --git a/common/modules/blog/models/BlogTagLang.php b/common/modules/blog/models/BlogTagLang.php new file mode 100644 index 0000000..26de932 --- /dev/null +++ b/common/modules/blog/models/BlogTagLang.php @@ -0,0 +1,71 @@ + 255], + [['blog_tag_id', 'language_id'], 'unique', 'targetAttribute' => ['blog_tag_id', 'language_id'], 'message' => 'The combination of Blog Tag ID and Language ID has already been taken.'], + [['blog_tag_id'], 'exist', 'skipOnError' => true, 'targetClass' => BlogTag::className(), 'targetAttribute' => ['blog_tag_id' => 'id']], + [['language_id'], 'exist', 'skipOnError' => true, 'targetClass' => Language::className(), 'targetAttribute' => ['language_id' => 'id']], + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'blog_tag_id' => 'Blog Tag ID', + 'language_id' => 'Language ID', + 'label' => 'Label', + ]; + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getBlogTag() + { + return $this->hasOne(BlogTag::className(), ['id' => 'blog_tag_id']); + } + + /** + * @return \yii\db\ActiveQuery + */ + public function getLanguage() + { + return $this->hasOne(Language::className(), ['id' => 'language_id']); + } +} diff --git a/common/modules/blog/models/BlogTagSearch.php b/common/modules/blog/models/BlogTagSearch.php new file mode 100644 index 0000000..1380599 --- /dev/null +++ b/common/modules/blog/models/BlogTagSearch.php @@ -0,0 +1,74 @@ + $query, + ]); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + // grid filtering conditions + $query->andFilterWhere([ + 'id' => $this->id, + ]); + + return $dataProvider; + } +} diff --git a/common/modules/blog/views/blog-article/_form.php b/common/modules/blog/views/blog-article/_form.php new file mode 100644 index 0000000..31fce7b --- /dev/null +++ b/common/modules/blog/views/blog-article/_form.php @@ -0,0 +1,35 @@ + + +
+ = Html::a('Create Blog Article', ['create'], ['class' => 'btn btn-success']) ?> +
+ = GridView::widget([ + 'dataProvider' => $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'id', + 'image', + 'created_at', + 'updated_at', + 'deleted_at', + // 'sort', + // 'status:boolean', + // 'author_id', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> ++ = Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> + = Html::a('Delete', ['delete', 'id' => $model->id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => 'Are you sure you want to delete this item?', + 'method' => 'post', + ], + ]) ?> +
+ + = DetailView::widget([ + 'model' => $model, + 'attributes' => [ + 'id', + 'image', + 'created_at', + 'updated_at', + 'deleted_at', + 'sort', + 'status:boolean', + 'author_id', + ], + ]) ?> + ++ = Html::a('Create Blog Category', ['create'], ['class' => 'btn btn-success']) ?> +
+ = GridView::widget([ + 'dataProvider' => $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'id', + 'sort', + 'image', + 'parent_id', + 'status:boolean', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> ++ = Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> + = Html::a('Delete', ['delete', 'id' => $model->id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => 'Are you sure you want to delete this item?', + 'method' => 'post', + ], + ]) ?> +
+ + = DetailView::widget([ + 'model' => $model, + 'attributes' => [ + 'id', + 'sort', + 'image', + 'parent_id', + 'status:boolean', + ], + ]) ?> + ++ = Html::a('Create Blog Tag', ['create'], ['class' => 'btn btn-success']) ?> +
+ = GridView::widget([ + 'dataProvider' => $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'id', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> ++ = Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> + = Html::a('Delete', ['delete', 'id' => $model->id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => 'Are you sure you want to delete this item?', + 'method' => 'post', + ], + ]) ?> +
+ + = DetailView::widget([ + 'model' => $model, + 'attributes' => [ + 'id', + ], + ]) ?> + ++ This is the view content for action "= $this->context->action->id ?>". + The action belongs to the controller "= get_class($this->context) ?>" + in the "= $this->context->module->id ?>" module. +
+
+ You may customize this page by editing the following file:
+ = __FILE__ ?>
+