/** * @param string $slug * @return mixed */ public function actionSlugrubric($slug) { $rubric = ContentRubrics::find()->where(['=', 'slug', $slug])->andWhere(['=', 'section_id', 7])->one(); if (!isset($rubric->id)) { return $this->redirect('/methods'); } $query = Content::find()->where(['=', 'section_id', 7])->andWhere(['=', '`contentmanager_content`.`lang_id`', Lang::getCurrent()->id])->andWhere(['=', 'published', true])->andWhere(['=', 'rubric_id', $rubric->id])->orderBy('date DESC'); $countQuery = clone $query; $pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => 3]); $models = $query->offset($pages->offset)->limit($pages->limit)->all(); return $this->render('rubric', ['models' => $models, 'pages' => $pages, 'rubric' => $rubric, 'rubrics' => ContentRubrics::findBySection(7)]); }
<!-- Blog Search Well --> <div class="well"> <h4>Content Search</h4> <div class="input-group"> <input type="text" class="form-control"> <span class="input-group-btn"> <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button> </span> </div> <!-- /.input-group --> </div> <!-- Blog Categories Well --> <br> <?php echo partialWidget::widget(['items' => ContentRubrics::findBySection(8), 'itemView' => '@frontend/views/partials/rubricsBlocks/items.php', 'wrapView' => '@frontend/views/partials/rubricsBlocks/blockWrapper.php', 'itemParams' => ['controller' => 'events/rubric']]); ?> <!-- Side Widget Well --> <div class="well"> <h4>Tags Cloud</h4> <p></p> </div> </div> </div> <!-- /.row --> <hr> <!-- Pagination --> <div class="row text-center"> <div class="col-lg-12"> <?php