をリダイレクトhttp://book.cakephp.org/2.0/en/tutorials-and-examples/blog/part-two.htmlCakePHPの2.0ブログのチュートリアル次の行 がある、だから、ブログにCakePHP 2.0のチュートリアルで順番
<?php
public function edit($id = null) {
$this->Post->id = $id;
if ($this->request->is('get')) {
$this->request->data = $this->Post->read();
} else {
if ($this->Post->save($this->request->data)) {
$this->Session->setFlash('Your post has been updated.');
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash('Unable to update your post.');
}
}
}
なぜます$ this->セッション - > setFlash( 'あなたの投稿が更新されました。');リダイレクトラインの前に行く?リダイレクトされると、なぜメッセージが表示され、その逆も言わないようになります。最初にリダイレクトしてメッセージをフラッシュしますか?あなたはfalse
に三番目のパラメータを設定しない限り