deviceDetect->isMobile()) return ""; $query = \app\models\base\Comments::find()->andWhere(['visible'=>'Y'])->orderBy(['created_at'=>SORT_DESC])->limit(3); $view = $this; ?>

Комментарии в эфире

cache->getOrSet("header-comments",function () use ($query,$view){ $comments= \yii\helpers\Html::beginTag("ul",["class"=>"header-comments__list"]); foreach ($query->all() as $model) { $comments.= $view->render('_header_comments_item',['model'=>$model]); } $comments.= \yii\helpers\Html::endTag("ul"); return $comments; },60); ?>