I have problem. I have tasks and inside messages. When i delete some message , i can redirect to site " ‘task/update’, array(‘id’=>$model->id))); " .
My delete function:
public function actionDeleteMessage($id) {
$this->loadModels($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('task/update', array('id'=>$id)));
}
I have error:
Undefined variable: model
how I can appeal to $model->id task , when i have only $id in Message.
public function actionDeleteMessage($id) {
$model=$this->loadModels($id);
$model->delete();
if (!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('task/update', array('id'=>$model->id)));
}