Zend_Validate-GreaterThan.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect2 id="zend.validate.set.greaterthan">
  4. <title>GreaterThan</title>
  5. <para>
  6. <classname>Zend_Validate_GreaterThan</classname> allows you to validate if a given value is
  7. greater than a minimum border value.
  8. </para>
  9. <note>
  10. <title>Zend_Validate_GreaterThan supports only number validation</title>
  11. <para>
  12. It should be noted that <classname>Zend_Validate_GreaterThan</classname> supports only
  13. the validation of numbers. Strings or dates can not be validated with this validator.
  14. </para>
  15. </note>
  16. <sect3 id="zend.validate.set.greaterthan.options">
  17. <title>Supported options for Zend_Validate_GreaterThan</title>
  18. <para>
  19. The following options are supported for
  20. <classname>Zend_Validate_GreaterThan</classname>:
  21. </para>
  22. <itemizedlist>
  23. <listitem>
  24. <para>
  25. <emphasis><property>min</property></emphasis>: Sets the minimum border value.
  26. </para>
  27. </listitem>
  28. </itemizedlist>
  29. </sect3>
  30. <sect3 id="zend.validate.set.greaterthan.basic">
  31. <title>Basic usage</title>
  32. <para>
  33. To validate if a given value is greater than a defined border simply use the following
  34. example.
  35. </para>
  36. <programlisting language="php"><![CDATA[
  37. $valid = new Zend_Validate_GreaterThan(array('min' => 10));
  38. $value = 11;
  39. $return = $valid->isValid($value);
  40. // returns true
  41. ]]></programlisting>
  42. <para>
  43. The above example returns <constant>TRUE</constant> for all values which are greater
  44. than 10.
  45. </para>
  46. <programlisting language="php"><![CDATA[
  47. $valid = new Zend_Validate_GreaterThan(array('min' => 10));
  48. $value = 10;
  49. $return = $valid->isValid($value);
  50. // returns false
  51. ]]></programlisting>
  52. <para>
  53. The above example returns <constant>FALSE</constant> for all values which are lesser
  54. or equal to the minimum border value.
  55. </para>
  56. </sect3>
  57. </sect2>
  58. <!--
  59. vim:se ts=4 sw=4 et:
  60. -->