Ejemplo n.º 1
0
 /**
  * Displays a post detail.
  * @param integer $id
  * @return mixed
  */
 public function actionDetail($id)
 {
     $postModel = new Comment();
     if ($postModel->load(Yii::$app->request->post())) {
         $postModel->status = Comment::STATUS_PENDING;
         $postModel->post_id = $id;
         if ($postModel->save()) {
             $this->added = 1;
         }
     }
     $tags = Tag::findTagWeights(Yii::$app->params['tagCloudCount']);
     $commentModel = new Comment();
     $commentDataProvider = $commentModel->findRecentComments(Yii::$app->params['recentCommentCount']);
     //Yii::$app->params['recentCommentCount']
     return $this->render('detail', ['model' => $this->findModel($id), 'commentDataProvider' => $commentDataProvider, 'tags' => $tags, 'postModel' => $postModel, 'added' => $this->added]);
 }