123456789101112131415161718192021222324252627282930 |
- <?php
- /**
- * @var integer $topic_id
- */
- $newsDataProvider = new \yii\data\ActiveDataProvider(
- [
- "query"=>\app\models\News::find()->joinWith("topics t")->andWhere(["t.id"=>[$topic_id,]]),
- "pagination" =>[
- "pageSize"=>3
- ],
- ]
- );
- echo \yii\helpers\Html::beginTag("div",["class"=>"partner-news row"]);
- echo Yii::$app->cache->getOrSet("main-page-third-row-".$topic_id,function () use ($newsDataProvider){
- return \yii\widgets\ListView::widget([
- "dataProvider" => $newsDataProvider,
- 'options' => [
- 'tag' => false,
- 'class' => 'list-wrapper',
- 'id' => 'list-wrapper',
- ],
- "itemOptions"=>[
- "tag"=>false
- ],
- "itemView" => "_partner_news_item",
- "layout" => "{items}"
- ]);
- },600);
- echo \yii\helpers\Html::endTag("div");
|