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

Class: HTML_QuickForm_Rule_Callback

Source Location: /main/inc/lib/pear/HTML/QuickForm/Rule/Callback.php

Class Overview

HTML_QuickForm_Rule
   |
   --HTML_QuickForm_Rule_Callback

Validates values using callback functions or methods


Author(s):

Version:

  • 1.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTML_QuickForm_Rule

HTML_QuickForm_Rule::getValidationScript()
Returns the javascript test (the test should return true if the value is INVALID)
HTML_QuickForm_Rule::setName()
Sets the rule name
HTML_QuickForm_Rule::validate()
Validates a value

Class Details

[line 27]
Validates values using callback functions or methods



Tags:

version:  1.0


[ Top ]


Class Variables

$_BCMode = array()

[line 51]

Whether to use BC mode for specific rules

Previous versions of QF passed element's name as a first parameter to validation functions, but not to validation methods. This behaviour is emulated if you are using 'function' as rule type when registering.




Tags:

access:  private

Type:   array


[ Top ]

$_data = array()

[line 39]

Array of callbacks

Array is in the format: $_data['rulename'] = array('functionname', 'classname'); If the callback is not a method, then the class name is not set.




Tags:

access:  private

Type:   array


[ Top ]



Class Methods


method addData [line 88]

void addData( string $name, string $callback, [string $class = null], [bool $BCMode = false])

Adds new callbacks to the callbacks list



Tags:

access:  public


Parameters:

string   $name   Name of rule
string   $callback   Name of function or method
string   $class   Name of class containing the method
bool   $BCMode   Backwards compatibility mode

[ Top ]

method getValidationScript [line 99]

void getValidationScript( [ $options = null])



Overrides HTML_QuickForm_Rule::getValidationScript() (Returns the javascript test (the test should return true if the value is INVALID))

Parameters:

   $options  

[ Top ]

method validate [line 61]

boolean validate( string $value, [mixed $options = null])

Validates a value using a callback



Tags:

return:  true if value is valid
access:  public


Overrides HTML_QuickForm_Rule::validate() (Validates a value)

Parameters:

string   $value   Value to be checked
mixed   $options   Options for callback

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:01:51 -0500 by phpDocumentor 1.4.1