demos/blog/protected/controllers/CommentController.php
public function actionApprove()
	{
		if(Yii::app()->request->isPostRequest)
		{
			$comment=$this->loadModel();
			$comment->approve();
			$this->redirect(array('index'));
		}
		else
			throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
	}
public function actionApprove()
	{
		if(Yii::app()->request->isPostRequest)
		{
			$comment=$this->loadModel();
			$comment->approve();
			$this->redirect(array('index'));
		}
		else
			throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
	}
public function actionApprove ( ) { if ( Yii :: app ( ) -> request -> isPostRequest ) { $ comment = $ this -> loadModel ( ) ; $ comment -> approve ( ) ; $ this -> redirect ( array ( 'index' ) ) ; } else throw new CHttpException ( 400 , 'Invalid request. Please do not repeat this request again.' ) ; }
Approves a particular comment.
If approval is successful, the browser will be redirected to the comment index page.
Approves a particular comment . If approval is successful the browser will be redirected to the comment index page .