Class FormValidators

Description

FormValidators Class

Extend this class to supply your own validators, by default we supply most common

Located in /system/classes/formui.php (line 608)


	
			
Method Summary
static array validate_email (string $text)
static array validate_regex (string $value, FormControl $control, FormContainer $container, string $regex, [string $warning = NULL])
static array validate_required ( $value, string $text)
static array validate_url (string $text)
Methods
static method validate_email (line 634)

A validation function that returns an error if the value passed in is not a valid Email Address, as per RFC2822 and RFC2821.

  • return: An empty array if the string is a valid Email Address, or an array with strings describing the errors
  • access: public
static array validate_email (string $text)
  • string $text: A string to test if it is a valid Email Address
static method validate_regex (line 666)

A validation function that returns an error if the value passed does not match the regex specified.

  • return: An empty array if the value exists, or an array with strings describing the errors
  • access: public
static array validate_regex (string $value, FormControl $control, FormContainer $container, string $regex, [string $warning = NULL])
  • string $value: A value to test if it is empty
  • FormControl $control: The control that defines the value
  • FormContainer $container: The container that holds the control
  • string $regex: The regular expression to test against
  • string $warning: An optional error message
static method validate_required (line 648)

A validation function that returns an error if the value passed in is not set.

  • return: An empty array if the value exists, or an array with strings describing the errors
  • access: public
static array validate_required ( $value, string $text)
  • string $text: A value to test if it is empty
  • $value
static method validate_url (line 617)

A validation function that returns an error if the value passed in is not a valid URL.

  • return: An empty array if the string is a valid URL, or an array with strings describing the errors
  • access: public
static array validate_url (string $text)
  • string $text: A string to test if it is a valid URL

Documentation generated on Thu, 30 Oct 2008 20:31:16 +0100 by phpDocumentor 1.3.2