\app\models\News::getMainView()->orderBy(["dt_pub"=>SORT_DESC])->limit(3), "pagination" =>[ "pageSize"=>4 ], ] ); echo \yii\helpers\Html::beginTag("div",["class"=>"main-view"]); echo Yii::$app->cache->getOrSet("main-page-main-view",function () use ($newsDataProvider){ return \yii\widgets\ListView::widget([ "dataProvider" => $newsDataProvider, 'options' => [ 'tag' => false, 'class' => 'list-wrapper', 'id' => 'list-wrapper', ], "itemOptions"=>[ "tag"=>false ], "itemView" => "_main_view_item", "layout" => "{items}" ]); },600); echo \yii\helpers\Html::endTag("div");