HTML_QuickForm
[ class tree: HTML_QuickForm ] [ index: HTML_QuickForm ] [ all elements ]

Source for file Rule.php

Documentation is available at Rule.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4.0                                                      |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Bertrand Mansion <bmansion@mamasam.com>                     |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: Rule.php,v 1.2 2003/11/03 16:08:22 avb Exp $
  20.  
  21. {
  22.    /**
  23.     * Name of the rule to use in validate method
  24.     *
  25.     * This property is used in more global rules like Callback and Regex
  26.     * to determine which callback and which regex is to be used for validation
  27.     *
  28.     * @var  string 
  29.     * @access   public
  30.     */
  31.     var $name;
  32.  
  33.    /**
  34.     * Validates a value
  35.     * 
  36.     * @access public
  37.     * @abstract
  38.     */
  39.     function validate($value)
  40.     {
  41.         return true;
  42.     }
  43.  
  44.    /**
  45.     * Sets the rule name
  46.     * 
  47.     * @access public
  48.     */
  49.     function setName($ruleName)
  50.     {
  51.         $this->name = $ruleName;
  52.     }
  53.  
  54.     /**
  55.      * Returns the javascript test (the test should return true if the value is INVALID)
  56.      *
  57.      * @param     mixed     Options for the rule
  58.      * @access    public
  59.      * @return    array     first element is code to setup validation, second is the check itself
  60.      */
  61.     function getValidationScript($options = null)
  62.     {
  63.         return array('''');
  64.     }
  65. }
  66. ?>

Documentation generated on Mon, 11 Mar 2019 14:16:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.