http://localhost:8765/persons/edit/1
$person = $this->Persons->get($id);
if ($this->request->is(['post', 'put'])) {……
$person = $this->Persons->patchEntity($person, $this->request->data);
if ($this->Persons->save($person)) {
return $this->redirect(['action' => 'index']);
}
} else {
$this->set('person', $person);
}
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
public function edit($id = null) { $person = $this->Persons->get($id); if ($this->request->is(['post', 'put'])) { $person = $this->Persons->patchEntity($person, $this->request->data); if ($this->Persons->save($person)) { return $this->redirect(['action' => 'index']); } } else { $this->set('person', $person); } }
<< 前へ | 次へ >> |