Пример #1
0
 /**
  * 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]);
 }
Пример #2
0
 /**
  * Колличество комментариев блога требующих проверки
  * @return int
  */
 public static function getCountCommentPending()
 {
     $modelComment = new PostComment();
     return $modelComment->getCount($modelComment::COMMENT_MODER_PENDING, $modelComment::TYPE_OF_COMMENT);
 }