Browse Source

Modified From::error() param $text's behavior

In param $text, you can set the rule key or the message for array key.
The order of priority to apply is 1 rule key, 2 message.
おやすー 9 years ago
parent
commit
96aa8cd61e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/View/Helper/FormHelper.php

+ 4 - 2
src/View/Helper/FormHelper.php

@@ -709,8 +709,10 @@ class FormHelper extends Helper
 
         if (is_array($text)) {
             $tmp = [];
-            foreach ($error as $e => $m) {
-                if (isset($text[$e])) {
+            foreach ($error as $k => $e) {
+                if (isset($text[$k])) {
+                    $tmp[] = $text[$k];
+                } else if (isset($text[$e])) {
                     $tmp[] = $text[$e];
                 } else {
                     $tmp[] = $e;