EthnaAdminにActionFormの編集をつけてみた
概要
ActionファイルのFormを書き換えます! ええ、強制的に書き換えます。。。
編集画面
編集を押すと設定ができます。更新ボタンを押すとActionFormのファイルを書き換えます! 非常に危険でバックアップとか取らないので注意してください! CSVとかSVNとかで履歴保存されているので壊しても大丈夫って状態での利用を想定しています。
<?php /** * Aaa.php * * @author {$author} * @package Neko * @version $Id: skel.action.php 568 2008-06-07 22:55:10Z mumumu-org $ */ /** * aaa Form implementation. * * @author {$author} * @access public * @package Neko */ class Neko_Form_Aaa extends Neko_ActionForm { /** * @access private * @var array form definition. */ var $form = array ( 'keyname' => array ( 'name' => '表示名5', 'type' => VAR_TYPE_STRING, 'type_error' => '値タイプ', 'form_type' => FORM_TYPE_TEXTAREA, 'required' => '1', 'required_error' => '必須エラー', 'min_error' => '最小値', 'max' => '1000', 'max_error' => '最大値', 'regexp' => '/aaaaaa/', 'regexp_error' => '正規表現', 'mbregexp' => 'aaaaaassssfg', 'mbregexp_error' => '正規表現2', 'custom' => 'checkMailaddress', 'filter' => 'numeric_zentohan', ), 'keyname3' => array ( 'name' => '表示名5', 'type' => VAR_TYPE_STRING, 'type_error' => '値タイプ', 'form_type' => FORM_TYPE_TEXTAREA, 'required' => '1', 'required_error' => '必須エラー', 'min_error' => '最小値', 'max' => '1000', 'max_error' => '最大値', 'regexp' => '/aaaaaa/', 'regexp_error' => '正規表現', 'mbregexp' => 'aaaaaassssfg', 'mbregexp_error' => '正規表現2', 'custom' => 'checkMailaddress', 'filter' => 'numeric_zentohan', ), ); /** * Form input value convert filter : sample * * @access protected * @param mixed $value Form Input Value * @return mixed Converted result. */ /* function _filter_sample($value) { // convert to upper case. return strtoupper($value); } */ } /** * aaa action implementation. * * @author {$author} * @access public * @package Neko */ class Neko_Action_Aaa extends Neko_ActionClass { /** * preprocess of aaa Action. * * @access public * @return string forward name(null: success. * false: in case you want to exit.) */ function prepare() { return null; } /** * aaa action implementation. * * @access public * @return string forward name. */ function perform() { return 'aaa'; } }
こんな感じの出力になります。var_exportで出力しているのでちょっとインデントとか気にしていません。(画像と出力があっていない。。。)