Class iPhorm_Element

Description

Located in /iPhorm/Element.php (line 3)


	
			
Direct descendents
Class Description
 class iPhorm_Element_File
Variable Summary
 array $_errors
 array $_filters
 boolean $_isArray
 mixed $_isMultiple
 string $_label
 string $_name
 boolean $_skipRender
 array $_validators
 mixed $_value
Method Summary
 iPhorm_Element __construct ( $name, [ $label = ''])
 void addFilter (string|iPhorm_Filter_Interface $filter, [ $options = array()])
 void addFilters ( $filters)
 void addValidator (string|iPhorm_Validator_Interface $validator, [ $options = array()])
 void addValidators ( $validators)
 void clearFilters ()
 void clearValidators ()
 array getErrors ()
 iPhorm_Filter_Interface|null getFilter (string $filter)
 array getFilters ()
 void getIsArray (boolean $flag)
 boolean getIsMultiple ()
 string getLabel ()
 string getName ()
 boolean getSkipRender ()
 iPhorm_Validator_Interface|null getValidator (string $validator)
 array getValidators ()
 string getValue ()
 string getValueUnfiltered ()
 boolean hasErrors ()
 boolean hasFilter ( $filter, string $name)
 boolean hasFilters ()
 boolean hasValidator ( $validator, string|iPhorm_Validator_Interface $name)
 boolean hasValidators ()
 boolean isValid (string $value, [array $context = null])
 void removeFilter (string $filter)
 void removeValidator (string $validator)
 void setFilters ( $filters)
 void setForm (iPhorm $form)
 void setIsArray ([boolean $flag = true])
 void setIsMultiple ([boolean $flag = true])
 void setLabel (string $label)
 void setName (string $name)
 void setRequired ([boolean $flag = true])
 void setSkipRender ([boolean $flag = true])
 void setValidators ( $validators)
 void setValue (srting $value)
 void _filterValue ( &$value, string $value)
 void _filterValueRecursive ( &$value, array $value)
 null|iPhorm_Filter_Interface _loadFilter (string $filter, [array $options = array()])
 null|iPhorm_Validator_Interface _loadValidator (string $validator, [array $options = array()])
 string _prettyName (string $name)
Variables
array $_errors = array() (line 45)

Error messages

  • access: protected
array $_filters = array() (line 31)

Element filters

  • access: protected
iPhorm $_form = null (line 72)

The form this element belongs to

  • access: protected
boolean $_isArray = false (line 58)

Is the element in an array?

  • access: protected
mixed $_isMultiple = false (line 51)

Is the element multiple input e.g. multiple select

  • access: protected
string $_label (line 17)

Element label

  • access: protected
string $_name (line 10)

Element name

  • access: protected
boolean $_skipRender = false (line 65)

Should the element be skipped by success handlers

  • access: protected

Redefined in descendants as:
array $_validators = array() (line 38)

Element validators

  • access: protected
mixed $_value (line 24)

Element value

  • access: protected
Methods
Constructor __construct (line 74)
  • access: public
iPhorm_Element __construct ( $name, [ $label = ''])
  • $name
  • $label

Redefined in descendants as:
addFilter (line 200)

Add a filter

  • access: public
void addFilter (string|iPhorm_Filter_Interface $filter, [ $options = array()])
addFilters (line 219)

Add multiple filters

  • access: public
void addFilters ( $filters)
  • array $filters: The array of filter names or instances
addValidator (line 347)

Add a validator

  • access: public
void addValidator (string|iPhorm_Validator_Interface $validator, [ $options = array()])
addValidators (line 366)

Add mutliple validators

  • access: public
void addValidators ( $validators)
  • array $validators: The validators to add
clearFilters (line 253)

Remove all filters

  • access: public
void clearFilters ()
clearValidators (line 400)

Remove all validators

  • access: public
void clearValidators ()
getErrors (line 587)

Get the error messages

  • return: The error messages
  • access: public
array getErrors ()
getFilter (line 309)

Get the filter with the given name

  • return: The filter or null if the element does not have the filter
  • access: public
iPhorm_Filter_Interface|null getFilter (string $filter)
  • string $filter: The name of the filter
getFilters (line 273)

Get the filters

  • return: The array of filters
  • access: public
array getFilters ()
getForm (line 638)

Get the form the element belongs to

  • access: public
iPhorm getForm ()
getFullyQualifiedName (line 143)

Get the fully qualified name of the element

  • access: public
string getFullyQualifiedName ()
getIsArray (line 190)

Is the element an array?

  • access: public
void getIsArray (boolean $flag)
  • boolean $flag
getIsMultiple (line 169)

Does this element have multiple values?

  • access: public
boolean getIsMultiple ()
getLabel (line 133)

Get the label of the element

  • return: The label of the element
  • access: public
string getLabel ()
getName (line 113)

Get the name of the element

  • return: The name of the element
  • access: public
string getName ()
getSkipRender (line 618)

Should the element be skipped during rendering

  • access: public
boolean getSkipRender ()
getValidator (line 456)

Get the validator with the given name

  • return: The validator or null if the element does not have the validator
  • access: public
iPhorm_Validator_Interface|null getValidator (string $validator)
  • string $validator: The name of the validator
getValidators (line 420)

Get the validators

  • return: The validators
  • access: public
array getValidators ()
getValue (line 528)

Get the filtered value

  • return: The filtered value
  • access: public
string getValue ()
getValueUnfiltered (line 508)

Get the unfiltered (raw) value

  • return: The raw value
  • access: public
string getValueUnfiltered ()
hasErrors (line 597)

Does the element have errors?

  • access: public
boolean hasErrors ()
hasFilter (line 284)

Does the element have the given filter?

  • access: public
boolean hasFilter ( $filter, string $name)
  • string $name: The name of the filter
  • $filter
hasFilters (line 263)

Does this element have filters?

  • access: public
boolean hasFilters ()
hasValidator (line 431)

Does the element have the given validator?

  • access: public
boolean hasValidator ( $validator, string|iPhorm_Validator_Interface $name)
hasValidators (line 410)

Does the element have any validators?

  • access: public
boolean hasValidators ()
isValid (line 548)

Is the given value valid?

  • return: True if valid, false otherwise
  • access: public
boolean isValid (string $value, [array $context = null])
  • string $value: The value to check
  • array $context: The other submitted form values

Redefined in descendants as:
removeFilter (line 330)

Remove a filter with the given name

  • access: public
void removeFilter (string $filter)
  • string $filter: The name of the filter
removeValidator (line 477)

Remove a validator with the given name

  • access: public
void removeValidator (string $validator)
  • string $validator: The name of the validator
setFilters (line 244)

Set the filters, overrides previously added filters

  • access: public
void setFilters ( $filters)
  • array $filters: The array of filter names or instances
setForm (line 628)

Set the form the element belongs to

  • access: public
void setForm (iPhorm $form)
setIsArray (line 180)

Set the flag to indicate that the element is an array.

  • access: public
void setIsArray ([boolean $flag = true])
  • boolean $flag
setIsMultiple (line 159)

Set the flag that the element can have multiple values.

  • access: public
void setIsMultiple ([boolean $flag = true])
  • boolean $flag
setLabel (line 123)

Set the label of the element

  • access: public
void setLabel (string $label)
  • string $label: The label to set
setName (line 103)

Set the name of the element

  • access: public
void setName (string $name)
  • string $name: The name to set
setRequired (line 494)

Sets whether the element is required or not

  • access: public
void setRequired ([boolean $flag = true])
  • boolean $flag

Redefined in descendants as:
setSkipRender (line 608)

Set whether or not the value should be rendered by success handlers

  • access: public
void setSkipRender ([boolean $flag = true])
  • boolean $flag
setValidators (line 391)

Set the validators, overrides previously added validators

  • access: public
void setValidators ( $validators)
  • array $validators: The validators to add
setValue (line 518)

Set the value

  • access: public
void setValue (srting $value)
  • srting $value: The value to set
_filterValue (line 648)

Filter the given value by reference

  • access: protected
void _filterValue ( &$value, string $value)
  • string $value
  • &$value
_filterValueRecursive (line 660)

Recursively filter the given value by reference

  • access: protected
void _filterValueRecursive ( &$value, array $value)
  • array $value
  • &$value
_loadFilter (line 676)

Load the filter instance from the given name

  • return: The filter
  • access: protected
null|iPhorm_Filter_Interface _loadFilter (string $filter, [array $options = array()])
  • string $filter
  • array $options: Options to pass to the filter
_loadValidator (line 701)

Load the validator instance from the given name

  • return: The validator
  • access: protected
null|iPhorm_Validator_Interface _loadValidator (string $validator, [array $options = array()])
  • string $validator
  • array $options: Options to pass to the validator
_prettyName (line 727)

Get the pretty version of the form element name. Translates the machine name to a more human readable format. E.g.

"email_address" becomes "Email address".

  • return: The pretty version of the name
  • access: protected
string _prettyName (string $name)
  • string $name: The form element name

Documentation generated on Thu, 24 Feb 2011 22:19:37 +0000 by phpDocumentor 1.4.3