Browse Source

[ZF-5764] Zend_Form:

- added clearification about "NotEmpty"

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19535 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 years ago
parent
commit
6233e7f54f
1 changed files with 19 additions and 0 deletions
  1. 19 0
      documentation/manual/en/module_specs/Zend_Form-Elements.xml

+ 19 - 0
documentation/manual/en/module_specs/Zend_Form-Elements.xml

@@ -645,6 +645,25 @@ $messages = $element->getMessages();
             </para>
         </note>
 
+        <note>
+            <title>When is an element detected as empty?</title>
+
+            <para>
+                As mentioned the 'NotEmpty' validator is used to detect if an element is empty
+                or not. But <classname>Zend_Validate_NotEmpty</classname> does, per default, not
+                work like <acronym>PHP</acronym>'s method <methodname>empty()</methodname>.
+            </para>
+
+            <para>
+                This means when an element contains an integer <emphasis>0</emphasis> or an string
+                <emphasis>'0'</emphasis> then the element will be seen as not empty. If you want to
+                have a different behaviour you must create your own instance of
+                <classname>Zend_Validate_NotEmpty</classname>. There you can define the behaviour of
+                this validator. See <ulink
+                    linkend="zend.validate.set.notempty">Zend_Validate_NotEmpty</ulink> for details.
+            </para>
+        </note>
+
         <para>
             Methods associated with validation include:
         </para>