예제 #1
0
 public function actionPartners()
 {
     $this->layout = 'column2';
     $model = Banner::find()->all();
     if (!$model) {
         throw new NotFoundHttpException(\Yii::t('common', 'Page not found'));
     }
     return $this->render('partners', ['model' => $model]);
 }
예제 #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Banner::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]]);
     $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, 'img' => $this->img, 'type' => $this->type]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'link', $this->link])->andFilterWhere(['like', 'status', $this->status])->andFilterWhere(['like', 'description', $this->description]);
     return $dataProvider;
 }
예제 #3
0
        </div><!-- /.row -->
    </div><!-- /.container -->
</section><!-- /.section -->
    
    
<section id="partner" class="section middle-padding hidden-sm hidden-xs">
    <div class="container">
        <div class="row">
            <div class="col-md-3">
                <div class="heading-line color-info big"></div>
                <h2 class="lighter no-padding-top">Партнеры</h2>
            </div><!--/.col-->
            <div class="col-md-9 text-center info-partners">
                <div class="row">
        			<?php 
foreach (\backend\modules\banner\models\Banner::find()->orderBy('id ASC')->all() as $data) {
    ?>
                        <?php 
    if ($data->link) {
        ?>
                            <div class="col-md-3">
                                <a href="<?php 
        echo $data->link;
        ?>
" target="_blank">
                                    <img src="/images/<?php 
        echo $data->img;
        ?>
" />
                                </a>
                            </div>