where([ 'active'=>'Y'])->orderBy([ 'id' => SORT_DESC])->limit(3); $newsDataProvider = new \yii\data\ActiveDataProvider( [ "query"=>$query, "pagination" =>false, ] ); echo ""; if(!is_null($design->parent)){ echo Html::tag('h2',Html::a($design->parent->title,[$design->parent->getUrl()]),['class'=>"widget-title mt-2 text-center"]); } echo Html::beginTag("div",["class"=>"partner-news row"]); echo Yii::$app->cache->getOrSet("main-page-third-row-l2-".$design->id,function () use ($newsDataProvider){ return \yii\widgets\ListView::widget([ "dataProvider" => $newsDataProvider, 'options' => [ 'tag' => false, 'class' => 'list-wrapper', 'id' => 'list-wrapper', ], "itemOptions"=>[ "tag"=>false ], "itemView" => "_inquirer_item", "layout" => "{items}" ]); },60); echo \yii\helpers\Html::endTag("div");