2006-06-13 (火)
■ perform() と preforward() の使い分け
先日 にも例として出したコードだが、 テンプレート中でセレクトボックスの表示に使うこのような配列は、 どこで定義するのが妥当なのか?
$months = range(1, 12);
$this->af->setApp('months', $months);
最初、perform() の中にこのコードを書いていたが、 もしかするとこれは preforward() とやらに書くべきなのでは? そう思いながら処理の続きを書いてみて分かったが、 やはりこれは preforward() に書かないといけない。
以前書いた処理の順番 をもう少し詳しく書くと、
- アクションクラスの authenticate()
- アクションクラスの prepare()
- アクションクラスの perform()
- ビュークラスの preforward()
- テンプレートの表示
という順番で処理されていく。
return '******'; で遷移すると、 preforward() のところに飛んでいき、 perform() の処理は行われない。 だから、エラーで再入力を促す場合を考えると、 上のような処理は preforward() で行わないといけない。
逆に、編集画面の初期値を設定するような場合には、 もし preforward() でその処理を行ってしまうと、 入力のエラーで同じビューに戻ってきた場合に、 ユーザーがせっかく変更した値が上書きされてしまう。 だから、perform() 内で行うのが適切。
うん、ようやく分かってきた気がする。
[コメントを書く]
本日のリンク元
- 15 http://blogger.blog360.jp/552429/14382173
- 5 google検索(ethna preforward)
- 4 google検索(preforward)
- 3 google検索(Ethna perform)
- 3 google検索(preforward)
- 3 google検索(ethna 配列 preforward)
- 2 google検索(preforward)
- 2 google検索(preforward())
- 2 google検索(preForward)
- 2 google検索(preforward)
- 2 google検索(preforward)
- 2 google検索(preforward())
- 2 google検索(ethna preforward)
- 2 google検索(ethna perform)
- 2 google検索(php ethna preform)
- 2 google検索(ethna perform)
- 2 google検索(preforward)
- 2 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 google検索(PREFORWARD)
- 1 google検索(preforward)
- 1 google検索(php perform)
- 1 google検索(preforward)
- 1 google検索(perform ethna)
- 1 google検索(ethna perform)
- 1 google検索(ethna preforward)
- 1 google検索(フレームワーク php 処理の順番)
- 1 google検索(ethna perform)
- 1 google検索(ethna perform)
- 1 google検索(javascript perform)
- 1 google検索(ethna javascript Selectbox)
- 1 google検索(preforward)
- 1 google検索(prepare perfrom 違い Ethna)
- 1 google検索(preforward php)
- 1 google検索(preforward ethna)
- 1 google検索(preforward PHP)
- 1 google検索(preforward エラー処理)
- 1 google検索(preforward())
- 1 google検索(php perform())
- 1 google検索(php perform)
- 1 google検索(javascript preforward)
- 1 google検索(ethna perform)
- 1 google検索(ethna perform)
- 1 google検索(ethna 使い分け)
- 1 google検索(ethna アクションの順番)
- 1 google検索(ethna preforward )
- 1 google検索(PreForward)
- 1 google検索(PHP ethna 編集画面)
- 1 google検索(Ethna アクション prepare preform 使い分け)
- 1 google検索(preforward)
- 1 google検索(perform() php)
- 1 google検索(jquery 処理の順番)
- 1 google検索(prepare ethna perform)
- 1 google検索(preforward ethna)
- 1 google検索(preforward)
- 1 google検索(preforward())
- 1 google検索(preforward())
- 1 google検索(php Ethna テンプレート 初期値設定)
- 1 google検索(perform ethna)
- 1 google検索(perform ethna)
- 1 google検索(ethna prepare perform)
- 1 google検索(ethna preforward とは)
- 1 google検索(ethna perform return)
- 1 google検索(ethna perform())
- 1 google検索(ethna perform)
- 1 google検索(PHP perform)
- 1 google検索(PHP perform)
- 1 google検索(ETHNA preform)
- 1 google検索(編集画面 初期値 ethna)
- 1 google検索(preforward())
- 1 google検索(zendframework 再入力画面)
- 1 google検索(ethna perform return)
- 1 google検索(perform ethna)
- 1 google検索(PHP perform())
- 1 google検索($this->af->setApp $this->af->set 使い分け)
- 1 google検索(preforward)
- 1 google検索(perform() Ethna)
- 1 google検索(f)
- 1 http://www.google.co.jp/hws/search?hl=ja&q=preforw...
- 1 goo検索(javaScript セレクトボックスの表示)
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:FpBItug72-IJ:w...
- 1 http://72.14.235.104/search?q=cache:3ziqdCpJ3MkJ:w...
- 1 http://209.85.175.104/search?q=cache:FpBItug72-IJ:...
- 1 http://209.85.175.104/search?q=cache:FpBItug72-IJ:...
- 1 http://209.85.175.104/search?q=cache:FpBItug72-IJ:...
- 1 http://209.85.175.104/search?q=cache:FpBItug72-IJ:...
- 1 http://209.85.173.104/search?q=cache:FpBItug72-IJ:...
