\app\models\Kd::find()->orderBy(["order"=>SORT_ASC])->offset(3)->limit(3), "pagination" => false ] );*/ //$sort = $newsDataProvider->getModels(); /* $news = new \yii\data\ActiveDataProvider(); $models = []; foreach( $sort as $item ){ $models[] = \app\models\News::findOne($item->id); } $news->setModels($models); */ use yii\helpers\Html; 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" => "_partner_news_item", "layout" => "{items}" ]); },60); echo \yii\helpers\Html::endTag("div");