Zend_Validate-GreaterThan.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 Zend_Validate_GreaterThan supports only the validation of
  13. 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 <classname>Zend_Validate_GreaterThan</classname>:
  20. </para>
  21. <itemizedlist>
  22. <listitem>
  23. <para>
  24. <emphasis><property>min</property></emphasis>: Sets the minimum allowed value.
  25. </para>
  26. </listitem>
  27. </itemizedlist>
  28. </sect3>
  29. <sect3 id="zend.validate.set.greaterthan.basic">
  30. <title>Basic usage</title>
  31. <para>
  32. To validate if a given value is greater than a defined border simply use the following
  33. example.
  34. </para>
  35. <programlisting language="php"><![CDATA[
  36. $valid = new Zend_Validate_GreaterThan(array('min' => 10));
  37. $value = 10;
  38. $return = $valid->isValid($value);
  39. // returns true
  40. ]]></programlisting>
  41. <para>
  42. The above example returns <constant>TRUE</constant> for all values which are equal to 10
  43. or greater than 10.
  44. </para>
  45. </sect3>
  46. </sect2>
  47. <!--
  48. vim:se ts=4 sw=4 et:
  49. -->