/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = ReviewsRecord::find()->lang(); $dataProvider = new ActiveDataProvider(['query' => $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; } $query->andFilterWhere(['id' => $this->id, 'dateCreate' => $this->dateCreate, 'dateUpdate' => $this->dateUpdate]); $query->andFilterWhere(['like', 'lang', $this->lang])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'content', $this->content]); return $dataProvider; }
<!-- Testimonials Section --> <section class="page-section bg-dark bg-dark-alfa-90 fullwidth-slider" data-background="<?php echo $this->theme->getUrl("assets/images/full-width-images/section-bg-3.jpg"); ?> "> <?php foreach (\app\modules\reviews\models\ReviewsRecord::getLast() as $item) { ?> <!-- Slide Item --> <div> <div class="container relative"> <div class="row"> <div class="col-md-8 col-md-offset-2 align-center"> <!-- Section Icon --> <div class="section-icon"> <span class="icon-quote"></span> </div> <!-- Section Title --> <h3 class="small-title font-alt"><?php echo \app\modules\lang\models\Language::t('index', 'Что говорят о нас?'); ?> </h3> <blockquote class="testimonial white"> <p> <?php echo $item->content; ?> </p>