関数のどこで問題が発生したかを特定するのに問題があります。NetBeansを使用するか、関数の実行中に関数がどこで機能しなくなるのかを知ることができるかどうかを知りたいのですが。
関数を見たい場合は、ここにそのコピーがあります:
public function archive($id = null) {
if ($this->request->is('post')) {
$event = $this->Event->read(null, $id);
$archive['Archive'] = $event['Event'];
$archive['Archive']['archiveID'] = $event['Event']['eventID'];
unset($archive['Archive']['archiveID']);
$this->loadModel('Archive');
$this->Archive->create();
if ($this->Archive->save($archive)) {
// $this->Archive->invalidFields();
$this->redirect(array('action' => 'eventmanage'));
$this->Session->setFlash(__('The event has been archived'));
// $this->Event->delete($id);
} else {
$this->redirect(array('action' => 'eventmanage'));
$this->Session->setFlash(__('The event could not be archived, Please, contact the administrator.'));
}
}
}
so far i have tried using the `$errors = $this->Archive->validationErrors;` function but all i receive back is the word 'array'
アップデート
アーカイブとして保存するイベントがありますが、メッセージが送信$this->Session->setFlash(__('The event has been archived'));
されず、eventmanageにリダイレクトされず、/ Controller / Action / idへの新しいリンクが作成されます(例:/ events / archive / 14)。
ありがとう