Extension:Validator/0.2

Parameter definition
Keys:


 * aliases: Optional. Array. When omitted, empty array will be assumed.
 * required: Optional. Boolean. When omitted, false will be assumed.
 * type: Optional. String. Values like string, integer, number, ect. When omitted, string will be assumed. The type will be used to create additional criteria. New types can be added via Validator class hook.
 * notation-type: Array. String. Allows to indicate that the value is a list of values, instead of just one.
 * output-type: Array. String. Allows to do conversions on the resulting value. These can be array, list, js item list, ect.
 * criteria: Optional. Associative Array. When omitted, empty array will be assumed. Each array element has the criteria name as it's key, and criteria specifications in an array as value. New criteria definitions can be added via Validator class hook.
 * default: Optional. Mixed. When omitted, empty string will be assumed.

List example:

$yourParameters['parameterName'] = array (	'type' => 'integer',	'notation-type' => array('list', ';'),	'output-type' => array('list', ','),	'criteria' => array( 'in_array' => array(42, 420, 4242), ), );

An input of  will turn into   (string).

2nd list example:

$yourParameters['parameterName'] = array (	'type' => 'integer',	'notation-type' => array('list'),	'criteria' => array( 'in_range' => array(0, 1000), ), );

An input of  will turn into , and add an error for 4242.

Integer example:

$yourParameters['parameterName'] = array (	'aliases' => array('parameter-name', 'paramName'),	'required' => true,	'type' => 'integer',	'criteria' => array( 'in_range' => array(0, 100), 'is_prime' => array ),	'default' => 42 );