- フォームヘルパの動作を改善
-- 1つのテンプレートに 複数 {form} が指定されたときに、submitされたformに対してのみ補正処理が働くように改善 この場合、{form name=...} 属性の指定が必須。
-- 1つのテンプレートに 複数 {form} が置かれた場合に、それぞれのフォームの配列を区別するようにした
+- フォーム定義を動的に変更するためのAPIを追加
+-- Ethna_ActionForm#setFormDef_PreHelper
+--- Ethna_Backend や Ethna_Session が初期化後に呼ばれる
*** bug fix
}
/**
+ * ユーザが動的にフォーム定義を変更したい場合に
+ * このメソッドをオーバーライドします。
+ * $this->backend も初期化済みのため、DBやセッション
+ * の値に基づいてフォーム定義を変更することができます。
+ *
+ * @access public
+ */
+ function setFormDef_PreHelper()
+ {
+ // TODO: override this method.
+ }
+
+ /**
* ヘルパオブジェクト(アプリケーションオブジェクト)
* 経由でのフォーム値定義を設定する
*
// オブジェクト生成
$backend =& $this->getBackend();
+ $session =& $this->getSession();
+ $session->restore();
+
+ // 言語切り替えフックを呼ぶ
+ $this->_setLanguage($this->locale, $this->system_encoding, $this->client_encoding);
+ // アクションフォーム初期化
+ // フォーム定義、フォーム値設定
$form_name = $this->getActionFormName($action_name);
$this->action_form =& new $form_name($this);
+ $this->action_form->setFormDef_PreHelper();
$this->action_form->setFormVars();
$backend->setActionForm($this->action_form);
- // アクションに必要とされる全てのオブジェクトが
- // 初期化されたあと、言語切り替えフックを呼ぶ
- $session =& $this->getSession();
- $session->restore();
- $this->_setLanguage($this->locale, $this->system_encoding, $this->client_encoding);
-
// バックエンド処理実行
$forward_name = $backend->perform($action_name);