我有这个代码
$this->loadModel($model);
$this->Task->id = $id;
$this->Task->save($this->data[$model]);
如何设置“任务”模型,以便使其动态化,因为这不起作用:
$this->loadModel($model);
$this->$model->id = $id;
$this->$model->save($this->data[$model]);
我也试过这个没有运气:
$this->loadModel($model);
$this->currentModel = $model;
$this->currentModel->id = $id;
$this->currentModel->save($this->data[$model]);