/** * Lists all Post models. * @return mixed */ public function actionIndex() { $searchModel = new PostSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $modelComment = new PostComment(); $countPending = $modelComment->getCount($modelComment::COMMENT_MODER_PENDING, $modelComment::TYPE_OF_COMMENT); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'countPending' => $countPending]); }
/** * Колличество комментариев блога требующих проверки * @return int */ public static function getCountCommentPending() { $modelComment = new PostComment(); return $modelComment->getCount($modelComment::COMMENT_MODER_PENDING, $modelComment::TYPE_OF_COMMENT); }