diff --git a/backend/controllers/BgController.php b/backend/controllers/BgController.php index fbafd5c..599beee 100755 --- a/backend/controllers/BgController.php +++ b/backend/controllers/BgController.php @@ -154,7 +154,11 @@ */ protected function findModel($id) { - if(( $model = Bg::findOne($id) ) !== NULL) { + if(( $model = Bg::find() + ->where([ 'id' => $id ]) + ->with('lang') + ->one() ) !== NULL + ) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); diff --git a/backend/controllers/SeoCategoryController.php b/backend/controllers/SeoCategoryController.php index 0c390f0..09c7945 100755 --- a/backend/controllers/SeoCategoryController.php +++ b/backend/controllers/SeoCategoryController.php @@ -59,20 +59,6 @@ } /** - * Displays a single SeoCategory model. - * - * @param integer $id - * - * @return mixed - */ - public function actionView($id) - { - return $this->render('view', [ - 'model' => $this->findModel($id), - ]); - } - - /** * Creates a new SeoCategory model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed @@ -151,7 +137,11 @@ */ protected function findModel($id) { - if(( $model = SeoCategory::findOne($id) ) !== NULL) { + if(( $model = SeoCategory::find() + ->where([ 'seo_category_id' => $id ]) + ->with('lang') + ->one() ) !== NULL + ) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); diff --git a/backend/controllers/SeoController.php b/backend/controllers/SeoController.php index 84b137b..d1130d8 100755 --- a/backend/controllers/SeoController.php +++ b/backend/controllers/SeoController.php @@ -151,7 +151,11 @@ */ protected function findModel($id) { - if(( $model = Seo::findOne($id) ) !== NULL) { + if(( $model = Seo::find() + ->where([ 'seo_id' => $id ]) + ->with('lang') + ->one() ) !== NULL + ) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); diff --git a/backend/controllers/SeoDynamicController.php b/backend/controllers/SeoDynamicController.php index 2ce776a..1b10cff 100755 --- a/backend/controllers/SeoDynamicController.php +++ b/backend/controllers/SeoDynamicController.php @@ -2,6 +2,7 @@ namespace backend\controllers; + use common\models\SeoCategory; use Yii; use common\models\SeoDynamic; use common\models\SeoDynamicSearch; @@ -45,42 +46,52 @@ /** * Lists all SeoDynamic models. + * + * @param int $seo_category_id + * * @return mixed */ public function actionIndex($seo_category_id) { + $seo_category = $this->findCategory($seo_category_id); $searchModel = new SeoDynamicSearch(); $dataProvider = $searchModel->search($seo_category_id, Yii::$app->request->queryParams); return $this->render('index', [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - 'seo_category_id' => $seo_category_id, + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + 'seo_category' => $seo_category, ]); } /** * Displays a single SeoDynamic model. * + * @param integer $seo_category_id * @param integer $id * * @return mixed */ public function actionView($seo_category_id, $id) { + $seo_category = $this->findCategory($seo_category_id); return $this->render('view', [ - 'model' => $this->findModel($id), - 'seo_category_id' => $seo_category_id, + 'model' => $this->findModel($id), + 'seo_category' => $seo_category, ]); } /** * Creates a new SeoDynamic model. * If creation is successful, the browser will be redirected to the 'view' page. + * + * @param integer $seo_category_id + * * @return mixed */ public function actionCreate($seo_category_id) { + $seo_category = $this->findCategory($seo_category_id); $model = new SeoDynamic(); $model->generateLangs(); if($model->load(Yii::$app->request->post())) { @@ -89,14 +100,14 @@ if($model->save() && $model->transactionStatus) { return $this->redirect([ 'index', - 'seo_category_id' => $model->seo_category_id, + 'seo_category_id' => $seo_category_id, ]); } } return $this->render('create', [ - 'model' => $model, - 'model_langs' => $model->model_langs, - 'seo_category_id' => $seo_category_id, + 'model' => $model, + 'model_langs' => $model->model_langs, + 'seo_category' => $seo_category, ]); } @@ -104,27 +115,29 @@ * Updates an existing SeoDynamic model. * If update is successful, the browser will be redirected to the 'view' page. * + * @param integer $seo_category_id * @param integer $id * * @return mixed */ public function actionUpdate($seo_category_id, $id) { + $seo_category = $this->findCategory($seo_category_id); $model = $this->findModel($id); - $model_langs = $model->generateLangs(); + $model->generateLangs(); if($model->load(Yii::$app->request->post())) { $model->loadLangs(\Yii::$app->request); if($model->save() && $model->transactionStatus) { return $this->redirect([ 'index', - 'seo_category_id' => $model->seo_category_id, + 'seo_category_id' => $seo_category_id, ]); } } return $this->render('update', [ - 'model' => $model, - 'model_langs' => $model_langs, - 'seo_category_id' => $seo_category_id, + 'model' => $model, + 'model_langs' => $model->model_langs, + 'seo_category' => $seo_category, ]); } @@ -132,6 +145,7 @@ * Deletes an existing SeoDynamic model. * If deletion is successful, the browser will be redirected to the 'index' page. * + * @param integer $seo_category_id * @param integer $id * * @return mixed @@ -158,7 +172,24 @@ */ protected function findModel($id) { - if(( $model = SeoDynamic::findOne($id) ) !== NULL) { + if(( $model = SeoDynamic::find() + ->where([ 'seo_dynamic_id' => $id ]) + ->with('lang') + ->one() ) !== NULL + ) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } + + protected function findCategory($id) + { + if(( $model = SeoCategory::find() + ->where([ 'seo_category_id' => $id ]) + ->with('lang') + ->one() ) !== NULL + ) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); diff --git a/backend/controllers/SubscribeController.php b/backend/controllers/SubscribeController.php deleted file mode 100755 index 211bddf..0000000 --- a/backend/controllers/SubscribeController.php +++ /dev/null @@ -1,136 +0,0 @@ -[ - 'class' => AccessBehavior::className(), - 'rules' => - ['site' => - [ - [ - 'actions' => ['login', 'error'], - 'allow' => true, - ] - ] - ] - ], - 'verbs' => [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'delete' => ['POST'], - ], - ], - ]; - } - - /** - * Lists all Subscribe models. - * @return mixed - */ - public function actionIndex() - { - $searchModel = new SubscribeSearch(); - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - - return $this->render('index', [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - ]); - } - - /** - * Displays a single Subscribe model. - * @param integer $id - * @return mixed - */ - public function actionView($id) - { - return $this->render('view', [ - 'model' => $this->findModel($id), - ]); - } - - /** - * Creates a new Subscribe model. - * If creation is successful, the browser will be redirected to the 'view' page. - * @return mixed - */ - public function actionCreate() - { - $model = new Subscribe(); - - 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 Subscribe 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 Subscribe 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 Subscribe model based on its primary key value. - * If the model is not found, a 404 HTTP exception will be thrown. - * @param integer $id - * @return Subscribe the loaded model - * @throws NotFoundHttpException if the model cannot be found - */ - protected function findModel($id) - { - if (($model = Subscribe::findOne($id)) !== null) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); - } - } -} diff --git a/backend/views/bg/index.php b/backend/views/bg/index.php index 5c5994c..baf2d1b 100755 --- a/backend/views/bg/index.php +++ b/backend/views/bg/index.php @@ -1,32 +1,36 @@ title = \Yii::t('app', 'Bgs'); -$this->params['breadcrumbs'][] = $this->title; + + use yii\helpers\Html; + use yii\grid\GridView; + + /** + * @var yii\web\View $this + * @var common\models\BgSearch $searchModel + * @var yii\data\ActiveDataProvider $dataProvider + */ + $this->title = \Yii::t('app', 'Bgs'); + $this->params[ 'breadcrumbs' ][] = $this->title; ?>
- = Html::a(\Yii::t('app', 'Create Bg'), ['create'], ['class' => 'btn btn-success']) ?> + = Html::a(\Yii::t('app', 'Create Bg'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], 'id', - 'url', + 'url:url', + [ + 'attribute' => 'title', + 'value' => 'lang.title', + ], 'imageUrl:image', - ['class' => 'yii\grid\ActionColumn'], + [ 'class' => 'yii\grid\ActionColumn' ], ], ]); ?>- = Html::a(\Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> - = Html::a(\Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ + = Html::a(\Yii::t('app', 'Update'), [ + 'update', + 'id' => $model->id, + ], [ 'class' => 'btn btn-primary' ]) ?> + = Html::a(\Yii::t('app', 'Delete'), [ + 'delete', + 'id' => $model->id, + ], [ 'class' => 'btn btn-danger', - 'data' => [ + 'data' => [ 'confirm' => \Yii::t('app', 'Are you sure you want to delete this item?'), - 'method' => 'post', + 'method' => 'post', ], ]) ?>
- + = DetailView::widget([ - 'model' => $model, + 'model' => $model, 'attributes' => [ 'id', - 'url', + 'lang.title', + 'url:url', 'imageUrl:image', ], ]) ?> diff --git a/backend/views/certificate/index.php b/backend/views/certificate/index.php index fd3c673..b781a92 100755 --- a/backend/views/certificate/index.php +++ b/backend/views/certificate/index.php @@ -1,34 +1,42 @@ title = 'Certificates'; -$this->params['breadcrumbs'][] = $this->title; + + use common\models\Certificate; + use yii\helpers\Html; + use yii\grid\GridView; + + /** + * @var yii\web\View $this + * @var common\models\CertificateSearch $searchModel + * @var yii\data\ActiveDataProvider $dataProvider + */ + $this->title = 'Certificates'; + $this->params[ 'breadcrumbs' ][] = $this->title; ?>- = Html::a('Create Certificate', ['create'], ['class' => 'btn btn-success']) ?> + = Html::a('Create Certificate', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], 'certificate_id', 'name', - 'link', - - ['class' => 'yii\grid\ActionColumn'], + [ + 'attribute' => 'link', + 'value' => function($model) { + /** + * @var Certificate $model + */ + return Html::a($model->link, $model->getCertificateUrl()); + }, + 'format' => 'html', + ], + [ 'class' => 'yii\grid\ActionColumn' ], ], ]); ?>- = Html::a('Update', ['update', 'id' => $model->certificate_id], ['class' => 'btn btn-primary']) ?> - = Html::a('Delete', ['delete', 'id' => $model->certificate_id], [ + = Html::a('Update', [ + 'update', + 'id' => $model->certificate_id, + ], [ 'class' => 'btn btn-primary' ]) ?> + = Html::a('Delete', [ + 'delete', + 'id' => $model->certificate_id, + ], [ 'class' => 'btn btn-danger', - 'data' => [ + 'data' => [ 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', + 'method' => 'post', ], ]) ?>
- + = DetailView::widget([ - 'model' => $model, + 'model' => $model, 'attributes' => [ 'certificate_id', 'name', - 'link', + [ + 'attribute' => 'link', + 'value' => Html::a($model->link, $model->getCertificateUrl()), + 'format' => 'html', + ], ], ]) ?> diff --git a/backend/views/customer/_form.php b/backend/views/customer/_form.php index 476f0b7..9c6f5f3 100755 --- a/backend/views/customer/_form.php +++ b/backend/views/customer/_form.php @@ -1,44 +1,52 @@- = Html::a('Create Customer', ['create'], ['class' => 'btn btn-success']) ?> + = Html::a('Create Customer', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], + 'id', 'username', 'name', 'surname', - 'phone', - - ['class' => 'yii\grid\ActionColumn'], + 'phone', + 'email', + + [ 'class' => 'yii\grid\ActionColumn' ], ], ]); ?>- = Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> - = Html::a('Delete', ['delete', 'id' => $model->id], [ + = Html::a('Update', [ + 'update', + 'id' => $model->id, + ], [ 'class' => 'btn btn-primary' ]) ?> + = Html::a('Delete', [ + 'delete', + 'id' => $model->id, + ], [ 'class' => 'btn btn-danger', - 'data' => [ + 'data' => [ 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', + 'method' => 'post', ], ]) ?>
- + = DetailView::widget([ - 'model' => $model, + 'model' => $model, 'attributes' => [ 'id', 'username', @@ -39,6 +49,8 @@ $this->params['breadcrumbs'][] = $this->title; 'birth_year', 'body:ntext', 'group_id', + 'email', + 'created_at:date', ], ]) ?> diff --git a/backend/views/layouts/main-sidebar.php b/backend/views/layouts/main-sidebar.php index 3879424..07155e4 100755 --- a/backend/views/layouts/main-sidebar.php +++ b/backend/views/layouts/main-sidebar.php @@ -164,12 +164,6 @@ use yii\widgets\Menu; 'options' => ['class'=>\Yii::$app->user->can('bg')? '' :'hide'] ], [ - 'label' => 'Подписка', - 'template'=>' {label}', - 'url' => ['/subscribe/index'], - 'options' => ['class'=>\Yii::$app->user->can('subscribe') ? '' :'hide'], - ], - [ 'template'=>' {label}', 'label' => 'Пользователи', 'url' => ['/customer/index'], diff --git a/backend/views/seo-category/index.php b/backend/views/seo-category/index.php index c4dd174..25115de 100755 --- a/backend/views/seo-category/index.php +++ b/backend/views/seo-category/index.php @@ -1,68 +1,49 @@ title = Yii::t('app', 'Seo Categories'); -$this->params['breadcrumbs'][] = $this->title; + + use yii\helpers\Html; + use yii\grid\GridView; + use yii\helpers\Url; + + /** + * @var yii\web\View $this + * @var common\models\SeoCategorySearch $searchModel + * @var yii\data\ActiveDataProvider $dataProvider + */ + $this->title = Yii::t('app', 'Seo Categories'); + $this->params[ 'breadcrumbs' ][] = $this->title; ?>- = Html::a(Yii::t('app', 'Create Seo Category'), ['create'], ['class' => 'btn btn-success']) ?> + = Html::a(Yii::t('app', 'Create Seo Category'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], 'seo_category_id', 'controller', + [ + 'attribute' => 'name', + 'value' => 'lang.name', + ], 'status', [ - 'class' => 'yii\grid\ActionColumn', - 'template' => '{update} {image} {delete}', - 'buttons' => [ - 'update' => function ($url, $model) - { - return Html::a ( - '', - Url::toRoute(['seo-category/update', 'id' => $model->seo_category_id]), - [ - 'title' => "Редактировать", - ] - ); - }, - 'image' => function ($url, $model) - { - return Html::a ( - '', - Url::toRoute(['seo-dynamic/index', 'seo_category_id' => $model->seo_category_id]), - [ - 'title' => "слайды", - ] - ); - }, - 'delete' => function ($url, $model) - { - return Html::a ( - '', - Url::toRoute(['seo-category/delete', 'id' => $model->seo_category_id]), - [ - 'title' => "Удалить", - ] - ); + 'class' => 'yii\grid\ActionColumn', + 'template' => '{update} {image} {delete}', + 'buttons' => [ + 'image' => function($url, $model) { + return Html::a('', Url::toRoute([ + 'seo-dynamic/index', + 'seo_category_id' => $model->seo_category_id, + ]), [ + 'title' => \Yii::t('app', 'слайды'), + ]); }, ], - 'contentOptions' => ['style' => 'width: 70px;'], ], ], ]); ?> diff --git a/backend/views/seo-category/update.php b/backend/views/seo-category/update.php index 5a8ccc9..fe6d98b 100755 --- a/backend/views/seo-category/update.php +++ b/backend/views/seo-category/update.php @@ -13,13 +13,13 @@ $this->title = Yii::t('app', 'Update {modelClass}: ', [ 'modelClass' => 'Seo Category', - ]) . $model->seo_category_id; + ]) . $model->lang->name; $this->params[ 'breadcrumbs' ][] = [ 'label' => Yii::t('app', 'Seo Categories'), 'url' => [ 'index' ], ]; $this->params[ 'breadcrumbs' ][] = [ - 'label' => $model->seo_category_id, + 'label' => $model->lang->name, 'url' => [ 'view', 'id' => $model->seo_category_id, diff --git a/backend/views/seo-category/view.php b/backend/views/seo-category/view.php deleted file mode 100755 index 3411d25..0000000 --- a/backend/views/seo-category/view.php +++ /dev/null @@ -1,46 +0,0 @@ -title = $model->seo_category_id; - $this->params[ 'breadcrumbs' ][] = [ - 'label' => Yii::t('app', 'Seo Categories'), - 'url' => [ 'index' ], - ]; - $this->params[ 'breadcrumbs' ][] = $this->title; -?> -- = Html::a(Yii::t('app', 'Update'), [ - 'update', - 'id' => $model->seo_category_id, - ], [ 'class' => 'btn btn-primary' ]) ?> - = Html::a(Yii::t('app', 'Delete'), [ - 'delete', - 'id' => $model->seo_category_id, - ], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), - 'method' => 'post', - ], - ]) ?> -
- - = DetailView::widget([ - 'model' => $model, - 'attributes' => [ - 'seo_category_id', - 'controller', - 'status', - ], - ]) ?> - -= Html::a(Yii::t('app', 'Create Seo Dynamic'), Url::toRoute([ 'create', - 'seo_category_id' => $seo_category_id, + 'seo_category_id' => $seo_category->seo_category_id, ]), [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ @@ -28,30 +36,34 @@ 'columns' => [ [ 'class' => 'yii\grid\SerialColumn' ], 'seo_dynamic_id', - 'seo_category_id', + [ + 'attribute' => 'name', + 'value' => 'lang.name', + ], 'action', 'fields', + 'param', 'status', [ 'class' => 'yii\grid\ActionColumn', 'buttons' => [ 'view' => function($url, $model) { - return Html::a('', Url::toRoute([ + return Html::a('', [ 'view', 'seo_category_id' => $model->seo_category_id, 'id' => $model->seo_dynamic_id, - ]), [ - 'title' => "Просмотр", - ]); + ], [ + 'title' => \Yii::t('app', 'Просмотр'), + ]); }, 'update' => function($url, $model) { - return Html::a('', Url::toRoute([ + return Html::a('', [ 'update', 'seo_category_id' => $model->seo_category_id, 'id' => $model->seo_dynamic_id, - ]), [ - 'title' => "Редактировать", - ]); + ], [ + 'title' => \Yii::t('app', 'Редактировать'), + ]); }, 'delete' => function($url, $model) { diff --git a/backend/views/seo-dynamic/update.php b/backend/views/seo-dynamic/update.php index 10eeb11..93e2365 100755 --- a/backend/views/seo-dynamic/update.php +++ b/backend/views/seo-dynamic/update.php @@ -1,35 +1,39 @@ title = Yii::t('app', 'Update {modelClass}: ', [ 'modelClass' => 'Seo Dynamic', - ]) . $model->seo_dynamic_id; + ]) . $model->lang->name; $this->params[ 'breadcrumbs' ][] = [ - 'label' => Yii::t('app', 'Seo Dynamics'), - 'url' => Url::toRoute([ + 'label' => Yii::t('app', 'Seo Categories'), + 'url' => [ '/seo-category/index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $seo_category->lang->name, + 'url' => [ 'index', - 'seo_category_id' => $seo_category_id, - ]), + 'seo_category_id' => $seo_category->seo_category_id, + ], ]; $this->params[ 'breadcrumbs' ][] = [ - 'label' => $model->seo_dynamic_id, - 'url' => Url::toRoute([ + 'label' => $model->lang->name, + 'url' => [ 'view', - 'seo_category_id' => $seo_category_id, + 'seo_category_id' => $seo_category->seo_category_id, 'id' => $model->seo_dynamic_id, - ]), + ], ]; $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update'); ?> diff --git a/backend/views/seo-dynamic/view.php b/backend/views/seo-dynamic/view.php index 6505c0d..ec774c0 100755 --- a/backend/views/seo-dynamic/view.php +++ b/backend/views/seo-dynamic/view.php @@ -1,15 +1,25 @@ title = $model->seo_dynamic_id; + /** + * @var yii\web\View $this + * @var common\models\SeoDynamic $model + * @var SeoCategory $seo_category + */ + $this->title = $model->lang->name; $this->params[ 'breadcrumbs' ][] = [ - 'label' => Yii::t('app', 'Seo Dynamics'), - 'url' => [ 'index' ], + 'label' => Yii::t('app', 'Seo Categories'), + 'url' => [ '/seo-category/index' ], + ]; + $this->params[ 'breadcrumbs' ][] = [ + 'label' => $seo_category->lang->name, + 'url' => [ + 'index', + 'seo_category_id' => $seo_category->seo_category_id, + ], ]; $this->params[ 'breadcrumbs' ][] = $this->title; ?> @@ -20,11 +30,13 @@= Html::a(Yii::t('app', 'Update'), [ 'update', - 'id' => $model->seo_dynamic_id, + 'id' => $model->seo_dynamic_id, + 'seo_category_id' => $seo_category->seo_category_id, ], [ 'class' => 'btn btn-primary' ]) ?> = Html::a(Yii::t('app', 'Delete'), [ 'delete', - 'id' => $model->seo_dynamic_id, + 'id' => $model->seo_dynamic_id, + 'seo_category_id' => $seo_category->seo_category_id, ], [ 'class' => 'btn btn-danger', 'data' => [ @@ -35,13 +47,28 @@
= DetailView::widget([ - 'model' => $model, + 'model' => $model, 'attributes' => [ 'seo_dynamic_id', - 'seo_category_id', + [ + 'label' => \Yii::t('app', 'Seo Category'), + 'value' => Html::a($seo_category->lang->name, [ + 'index', + 'seo_category_id' => $seo_category->seo_category_id, + ]), + 'format' => 'html', + ], + 'lang.name', 'action', 'fields', + 'param', 'status', + 'lang.title', + 'lang.h1', + 'lang.key', + 'lang.meta', + 'lang.description', + 'lang.seo_text', ], ]) ?> diff --git a/backend/views/seo/index.php b/backend/views/seo/index.php index efe65d6..1c541b6 100755 --- a/backend/views/seo/index.php +++ b/backend/views/seo/index.php @@ -1,31 +1,51 @@ title = Yii::t('app', 'Seo'); -$this->params['breadcrumbs'][] = $this->title; + + use yii\helpers\Html; + use yii\grid\GridView; + + /** + * @var yii\web\View $this + * @var common\models\SeoSearch $searchModel + * @var yii\data\ActiveDataProvider $dataProvider + */ + $this->title = Yii::t('app', 'Seo'); + $this->params[ 'breadcrumbs' ][] = $this->title; ?>- = Html::a(Yii::t('app', 'Create Seo'), ['create'], ['class' => 'btn btn-success']) ?> + = Html::a(Yii::t('app', 'Create Seo'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], + 'filterModel' => $searchModel, + 'columns' => [ + [ 'class' => 'yii\grid\SerialColumn' ], 'seo_id', 'url', - ['class' => 'yii\grid\ActionColumn'], + [ + 'attribute' => 'title', + 'value' => 'lang.title', + ], + [ + 'attribute' => 'description', + 'value' => 'lang.description', + ], + [ + 'attribute' => 'h1', + 'value' => 'lang.h1', + ], + [ + 'attribute' => 'meta', + 'value' => 'lang.meta', + ], + [ + 'attribute' => 'seo_text', + 'value' => 'lang.seo_text', + ], + [ 'class' => 'yii\grid\ActionColumn' ], ], ]); ?>- = Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->seo_id], ['class' => 'btn btn-primary']) ?> - = Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->seo_id], [ + = Html::a(Yii::t('app', 'Update'), [ + 'update', + 'id' => $model->seo_id, + ], [ 'class' => 'btn btn-primary' ]) ?> + = Html::a(Yii::t('app', 'Delete'), [ + 'delete', + 'id' => $model->seo_id, + ], [ 'class' => 'btn btn-danger', - 'data' => [ + 'data' => [ 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), - 'method' => 'post', + 'method' => 'post', ], ]) ?>
- + = DetailView::widget([ - 'model' => $model, + 'model' => $model, 'attributes' => [ 'seo_id', 'url', + 'lang.title', + 'lang.description', + 'lang.h1', + 'lang.meta', + 'lang.seo_text', ], ]) ?> diff --git a/backend/views/subscribe/_form.php b/backend/views/subscribe/_form.php deleted file mode 100755 index 36ef492..0000000 --- a/backend/views/subscribe/_form.php +++ /dev/null @@ -1,25 +0,0 @@ - - -- = Html::a('Create Subscribe', ['create'], ['class' => 'btn btn-success']) ?> -
- = GridView::widget([ - 'dataProvider' => $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'id', - 'email:email', - 'sale', - 'sand', - - ['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', - 'email:email', - 'sale', - 'sand', - ], - ]) ?> - -