I have this code
$this->loadModel($model);
$this->Task->id = $id;
$this->Task->save($this->data[$model]);
How can I setup the "Task" model so I can make it dynamic because this doesn't work:
$this->loadModel($model);
$this->$model->id = $id;
$this->$model->save($this->data[$model]);
I also tried this with no luck:
$this->loadModel($model);
$this->currentModel = $model;
$this->currentModel->id = $id;
$this->currentModel->save($this->data[$model]);