Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function actionDelete($id)
- {
- if(Yii::app()->request->isPostRequest)
- {
- // we only allow deletion via POST request
- $this->loadModel($id)->delete();
- // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
- if(!isset($_GET['ajax']))
- $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
- }
- else
- throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement