fuelphpのValidation機能を利用して入力チェックを行おうと考えているのですが、エラーメッセージが取得できません。
コントローラー内
$val = Validation::forge(); $val->add('id','入力ID')->add_rule('required'); if (!$val->run()) { var_dump($val); };
app/config/config.php で日本語化設定をし
'language' => 'ja', 'language_fallback' => 'en', 'locale' => 'ja_JP.utf8',
configure/app/lang/ja/validation.phpにエラーメッセージを記載しているのですがエラー時にerror_messagesに値が入ってこずエラーメッセージが取得できません
return array( 'required' => ':labelは必須です', );
他に設定箇所はありますでしょうか?
{ ["fieldset": protected] => object(Fuel\ Core\ Fieldset) #28 (11) { ["name":protected]= > string(7) "default" ["fieldset_tag": protected] => NULL["fieldset_parent": protected] => NULL["fieldset_children": protected] => array(0) {}["fields": protected] => array(1) { [id"] => object(Fuel\ Core\ Fieldset_Field) #29 (12) { ["fieldset":protected]= > * RECURSION * ["name": protected] => string(12) "id" ["basename": protected] => string(12) "id" ["type": protected] => string(4) "text" ["label": protected] => string(23) "入力ID" ["value": protected] => NULL["description": protected] => string(0) "" ["rules": protected] => array(1) { [0] => array(2) { [0] => string(8) "required" [1] => array(0) {} } }["attributes": protected] => array(3) { ["type"] => string(4) "text" ["label"] => string(23) "入力ID" ["required"] => string(8) "required" }["options": protected] => array(0) {}["template": protected] => NULL["error_messages": protected] => array(0) {} } }["validation": protected] => * RECURSION * ["form": protected] => NULL["config": protected] => array(0) {}["disabled": protected] => array(0) {}["tabular_form_model": protected] => NULL["tabular_form_relation": protected] => NULL }["input": protected] => array(0) {}["validated": protected] => array(0) {}["errors": protected] => array(0) {}["callables": protected] => array(1) { [0] => * RECURSION * }["global_input_fallback": protected] => bool(true)["error_messages": protected] => array(0) {} }