/** * @inheritdoc */ public function run() { CommentListAsset::register($this->getView()); $this->processDelete(); $CommentsQuery = Comments\models\Comment::find()->byEntity($this->entity); if (false === $this->showDeleted) { $CommentsQuery->withoutDeleted(); } $CommentsDataProvider = new \yii\data\ActiveDataProvider(['query' => $CommentsQuery->with(['author', 'lastUpdateAuthor']), 'pagination' => $this->pagination, 'sort' => $this->sort]); $content = $this->render('comment-list', ['CommentsDataProvider' => $CommentsDataProvider]); return \yii\helpers\Html::tag('div', $content, $this->options); }
/** * @inheritdoc */ public function run() { CommentListAsset::register($this->getView()); $this->processDelete(); /** @var Comments\models\Comment $CommentModel */ $CommentModel = \Yii::createObject(Comments\Module::instance()->model('comment')); $CommentsQuery = $CommentModel::find()->byEntity($this->entity); if (false === $this->showDeleted) { $CommentsQuery->withoutDeleted(); } $CommentsDataProvider = new \yii\data\ActiveDataProvider(['query' => $CommentsQuery->with(['author', 'lastUpdateAuthor']), 'pagination' => $this->pagination, 'sort' => $this->sort]); $params = $this->viewParams; $params['CommentsDataProvider'] = $CommentsDataProvider; $content = $this->render('comment-list', $params); return \yii\helpers\Html::tag('div', $content, $this->options); }
/** * Register asset bundle */ protected function registerAssets() { CommentListAsset::register($this->getView()); }