\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");