/** * Deletes a particular model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id the ID of the model to be deleted */ public function actionDelete() { parent::actionDelete(); $id = $_POST['id']; foreach ($id as $ids) { $model = $this->loadModel($ids); $model->delete(); } echo CJSON::encode(array('status' => 'success', 'div' => 'Data deleted')); Yii::app()->end(); }