예제 #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
 /**
  * Finds the PostComment model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PostComment the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PostComment::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
예제 #3
0
파일: Admin.php 프로젝트: Dominus77/blog
 /**
  * Колличество комментариев блога требующих проверки
  * @return int
  */
 public static function getCountCommentPending()
 {
     $modelComment = new PostComment();
     return $modelComment->getCount($modelComment::COMMENT_MODER_PENDING, $modelComment::TYPE_OF_COMMENT);
 }