Cuando yo estaba tratando de borrar un mensaje que tengo este error:Yii Error 400 El token CSRF no pudo ser verificada al intentar eliminar el cargo
Yii Error 400 The CSRF token could not be verified
no sé exactamente lo que está causando esto y a lo que podría estar relacionado. aquí está mi acción de eliminación:
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.');
}
protected function afterDelete()
{
parent::afterDelete();
Image::model()->deleteAll('name='.$this->id);
Date::model()->deleteAll('tbl_show_id='.$this->id);
Press::model()->deleteAll('tbl_show_id='.$this->id);
}