cakephpの練習を最近はじめまして、サンプルを作成しています(ver2.9.4)
TestController.php
php
1<?php 2class TestController EXTENDS AppController{ 3 public $helper=array('Html','Form'); 4 public function index(){ 5 } 6 public function testForm(){ 7 if($this->request->is('post')){ 8 $this->redirect(array('action'=>'index')); 9 //$this->flash('入力完了、一覧へ戻ります',array('action'=>'index'),10); 10 } 11 } 12} 13
index.ctp
php
1<h1>indexページ</h1> 2<?php 3print $this->Html->link('formページ',array('action'=>'testForm')); 4?>
test_form.ctp
php
1<h1>formページ</h1> 2<?php 3print $this->Form->create('myForm'); 4print $this->Form->end('submit'); 5print $this->Html->link('index頁へもどる',array('action'=>'index')); 6?> 7
上記のリストでcore.phpのdebugを2にしています
TestController.phpをredirectにしている場合、画面遷移は正常に動きますが
コメントアウトしているflashに変えた場合、画面遷移のリンクがおかしくなってしまいmissing controllerが表示されてしまいます。
私のflashの解釈が間違っているのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/02 14:56
2017/02/02 20:35
2017/02/03 12:22
2017/02/03 14:31
2017/02/03 14:58
2017/02/03 15:06