Pluf_Encoder Class Reference

List of all members.

Public Member Functions

 setFormData (&$form)
 checkEmpty ($data, $form=array(), $p=array())

Static Public Member Functions

static url ($url, $form=array(), $p=array())
static varchar ($string, $form=array(), $p=array())
static password ($string, $form=array(), $p=array())
static email ($string, $form=array(), $p=array())
static text ($string, $form=array(), $p=array())
static sequence ($id, $form=array(), $p=array())
static boolean ($bool, $form=array(), $p=array())
static foreignkey ($id, $form=array(), $p=array())
static integer ($int, $form=array(), $p=array())
static datetime ($datetime, $form=array(), $p=array())
static date ($date, $form=array(), $p=array())
static manytomany ($vals, $form=array(), $p=array())
static float ($val, $form=array(), $p=array())

Protected Attributes

 $form = array()


Detailed Description

Validators are functions used to validate user/program input.

A validator signature is: my_validator($field_data, $params=array()) with $params an associative array of parameters.

A validator must fail on an empty string by raising an Pluf_Form_Invalid Exception or return the data in the right format (string, bool, whatever).

FIXME: Escape the strings when bad strings are sent in the error message.


Member Function Documentation

Pluf_Encoder::setFormData ( &$  form  ) 

Set the form data.

Parameters:
&array Reference to the form data

Pluf_Encoder::checkEmpty ( data,
form = array(),
p = array() 
)

Check if could be empty or not.

static Pluf_Encoder::url ( url,
form = array(),
p = array() 
) [static]

Validate an url. Only the structure is checked, no check of availability of the url is performed. It is a really basic validation.

static Pluf_Encoder::varchar ( string,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::password ( string,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::email ( string,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::text ( string,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::sequence ( id,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::boolean ( bool,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::foreignkey ( id,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::integer ( int,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::datetime ( datetime,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::date ( date,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::manytomany ( vals,
form = array(),
p = array() 
) [static]

static Pluf_Encoder::float ( val,
form = array(),
p = array() 
) [static]


Member Data Documentation

Pluf_Encoder::$form = array() [protected]

Store the complete form data if validation is coming from a form.


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen