Просмотр исходного кода

Zend_Filter_Input: minor documentation update. Closes [ZF-6710].

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@15628 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 16 лет назад
Родитель
Сommit
c51f6bee1f
1 измененных файлов с 22 добавлено и 0 удалено
  1. 22 0
      documentation/manual/en/module_specs/Zend_Filter_Input.xml

+ 22 - 0
documentation/manual/en/module_specs/Zend_Filter_Input.xml

@@ -901,6 +901,28 @@ $validators = array(
                 messages, and the tokens you can use in the message templates.
             </para>
 
+            <para>
+                If you have only one validator in validation rule or all used validators
+                has the same messages set, then they can be referenced without additional
+                array construction:
+            </para>
+
+            <programlisting language="php"><![CDATA[
+$validators = array(
+    'month' => array(
+        new Zend_Validate_Between(1, 12),
+        'messages' => array(
+                        Zend_Validate_Between::NOT_BETWEEN =>
+                            'Month value %value% must be between ' .
+                            '%min% and %max%',
+                        Zend_Validate_Between::NOT_BETWEEN_STRICT =>
+                            'Month value %value% must be strictly between ' .
+                            '%min% and %max%'
+        )
+    )
+);
+]]></programlisting>
+
         </sect3>
 
         <sect3 id="zend.filter.input.metacommands.global">