有効にする前に、メッセージを表示して保存を中止するには、コントローラに何を追加しますか?cakePHPの検証はどのように機能しますか?
public function add() {
if ($this->request->is('post')) {
var_dump($this->request->data);
$this->Rsvp->set('uname', $this->request->data['Post']['name']);
$this->Rsvp->set('uemail', $this->request->data['Post']['emailaddress']);
//Begin Validation Routine
echo 'Validation';
var_dump($this->Rsvp->validates);
$this->Rsvp->save();
/*if($this->Rsvp->save()) {
$this->Session->setFlash('You have RSVP for the event');
// $this->redirect(array('action' => 'index'));
}
else {
$this->Session->setFlash('Unable to RSVP you for the event.');
}*/
}
}