我正在尝试编辑数据,但这里编辑数据将是一个新条目,我们将删除旧数据。
所以我尝试了下面的代码来做到这一点
public function edit($id = null){
if ($this->request->is(array('post', 'put')))
{
$this->Transaction->create();
if ($this->Transaction->save($this->request->data)) {
$this->Transaction->delete();
$this->Session->setFlash(__('The transaction has been saved.'));
}
}
这里只发生了删除我没有得到新的条目数据。我怎样才能做到这一点?有人可以帮我吗?