weizhi 2012-10-12 17:39:53 2653次浏览 2条回复 0 0 0
public function actionDelete()
{
    if(Yii::app()->request->isPostRequest)
    {
        // we only allow deletion via POST request
        $this->loadModel()->delete();

        // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
    if(!isset($_POST['ajax']))
        $this->redirect(array('index'));
    }
    else
    throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
}

这个代码着实看不懂,不知道怎么用的 if(Yii::app()->request->isPostRequest) 这个条件什么时候才会成立呢? 不懂 不懂~

您需要登录后才可以回复。登录 | 立即注册