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

[ZF-8975] Zend_Validate:

- add description for Zend_Validate_Hex

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21047 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 лет назад
Родитель
Сommit
520f7b8a3b

+ 33 - 0
documentation/manual/en/module_specs/Zend_Validate-Hex.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Reviewed: no -->
+<sect2 id="zend.validate.set.hex">
+    <title>Hex</title>
+
+    <para>
+        <classname>Zend_Validate_Hex</classname> allows you to validate if a given value contains
+        only hexadecimal characters. These are all characters from <emphasis>0 to 9</emphasis> and
+        <emphasis>A to F</emphasis> case insensitive. There is no length limitation for the input
+        you want to validate.
+    </para>
+
+    <programlisting language="php"><![CDATA[
+$validator = new Zend_Validate_Hex();
+if ($validator->isValid('123ABC')) {
+    // value contains only hex chars
+} else {
+    // false
+}
+]]></programlisting>
+
+    <note>
+        <title>Invalid characters</title>
+
+        <para>
+            All other characters will return false, including whitespace and decimal point. Also
+            unicode zeros and numbers from other scripts than latin will not be treaten as valid.
+        </para>
+    </note>
+</sect2>
+<!--
+vim:se ts=4 sw=4 et:
+-->

+ 1 - 9
documentation/manual/en/module_specs/Zend_Validate-Set.xml

@@ -118,15 +118,7 @@
         </para>
     </sect2>
 
-    <sect2 id="zend.validate.set.hex">
-        <title>Hex</title>
-
-        <para>
-            Returns <constant>TRUE</constant> if and only if <varname>$value</varname> contains only
-            hexadecimal digit characters.
-        </para>
-    </sect2>
-
+    <xi:include href="Zend_Validate-Hex.xml" />
     <xi:include href="Zend_Validate-Hostname.xml" />
 
     <sect2 id="zend.validate.set.iban">