Zend_Validate-LessThan.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect2 id="zend.validate.set.lessthan">
  4. <title>LessThan</title>
  5. <para>
  6. <classname>Zend_Validate_LessThan</classname> allows you to validate if a given value is
  7. less than a maximum border value. It is the cousine of
  8. <classname>Zend_Validate_GreaterThan</classname>.
  9. </para>
  10. <note>
  11. <title>Zend_Validate_LessThan supports only number validation</title>
  12. <para>
  13. It should be noted that <classname>Zend_Validate_LessThan</classname> supports only the
  14. validation of numbers. Strings or dates can not be validated with this validator.
  15. </para>
  16. </note>
  17. <sect3 id="zend.validate.set.lessthan.options">
  18. <title>Supported options for Zend_Validate_LessThan</title>
  19. <para>
  20. The following options are supported for <classname>Zend_Validate_LessThan</classname>:
  21. </para>
  22. <itemizedlist>
  23. <listitem>
  24. <para>
  25. <emphasis><property>max</property></emphasis>: Sets the maximum allowed value.
  26. </para>
  27. </listitem>
  28. </itemizedlist>
  29. </sect3>
  30. <sect3 id="zend.validate.set.lessthan.basic">
  31. <title>Basic usage</title>
  32. <para>
  33. To validate if a given value is less than a defined border simply use the following
  34. example.
  35. </para>
  36. <programlisting language="php"><![CDATA[
  37. $valid = new Zend_Validate_LessThan(array('max' => 10));
  38. $value = 10;
  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 equal to 10
  44. or lower than 10.
  45. </para>
  46. </sect3>
  47. </sect2>
  48. <!--
  49. vim:se ts=4 sw=4 et:
  50. -->