diff --git a/frontend/controllers/BlogController.php b/frontend/controllers/BlogController.php index 63a00fc..720748f 100755 --- a/frontend/controllers/BlogController.php +++ b/frontend/controllers/BlogController.php @@ -30,7 +30,7 @@ ->where(['status' => true]) ->orderBy([ 'sort' => SORT_ASC ]) ->all(); - $data = ArrayHelper::map($categories, 'id', 'language.title'); + $data = ArrayHelper::map($categories, 'language.alias.value', 'language.title'); $dataProvider = new ActiveDataProvider( [ 'query' => Article::find() @@ -87,14 +87,16 @@ public function actionCategory($id) { - $tags = Tag::find() - ->with( - [ - 'language', - ] - ) - ->orderBy([ 'sort' => SORT_ASC ]) - ->all(); + $categories = Category::find() + ->with( + [ + 'language', + ] + ) + ->where(['status' => true]) + ->orderBy([ 'sort' => SORT_ASC ]) + ->all(); + $data = ArrayHelper::map($categories, 'language.alias.value', 'language.title'); /** * @var Category $model @@ -138,23 +140,25 @@ return $this->render( 'category', [ - 'tags' => $tags, 'dataProvider' => $dataProvider, 'model' => $model, + 'categories' => $data ] ); } public function actionTag($id) { - $tags = Tag::find() - ->with( - [ - 'language', - ] - ) - ->orderBy([ 'sort' => SORT_ASC ]) - ->all(); + $categories = Category::find() + ->with( + [ + 'language', + ] + ) + ->where(['status' => true]) + ->orderBy([ 'sort' => SORT_ASC ]) + ->all(); + $data = ArrayHelper::map($categories, 'language.alias.value', 'language.title'); /** * @var Category $model @@ -196,9 +200,9 @@ return $this->render( 'tag', [ - 'tags' => $tags, 'dataProvider' => $dataProvider, 'model' => $model, + 'categories' => $data ] ); } diff --git a/frontend/controllers/PackageController.php b/frontend/controllers/PackageController.php index 5bb6971..96f4d45 100644 --- a/frontend/controllers/PackageController.php +++ b/frontend/controllers/PackageController.php @@ -23,11 +23,11 @@ } public function actionIndex(){ - $dataProvider = new ActiveDataProvider([ - 'query' => Package::find()->with(['language.alias'])->where(['status' => true])->orderBy('sort') - ]); + + $packages = Package::find()->with(['language.alias'])->where(['status' => true])->orderBy('sort')->all(); + return $this->render('index', [ - 'dataProvider' => $dataProvider + 'packages' => $packages ]); } } \ No newline at end of file diff --git a/frontend/views/blog/category.php b/frontend/views/blog/category.php index 23b831d..e4295ba 100755 --- a/frontend/views/blog/category.php +++ b/frontend/views/blog/category.php @@ -1,10 +1,11 @@ get('seo'); $this->params[ 'breadcrumbs' ][] = [ - 'label' => \Yii::t('app', 'Блог'), - 'url' => [ 'blog/index' ], + 'label' => \Yii::t('app', 'Блог'), + 'url' => Url::to(['blog/index']) ]; - - $this->params[ 'breadcrumbs' ][] = $seo->title; + $this->params['breadcrumbs'][] = $model->title; ?> -