spunQ_DefaultFormFactory Class Reference

The default form factory. More...

Inheritance diagram for spunQ_DefaultFormFactory:

spunQ_FormFactory

List of all members.

Static Public Member Functions

static get ($type, array $params=array(), $recreate=false)
 Gets the form with given name.
static getByName ($name, $recreate=false)
 Gets the form with given name.

Protected Member Functions

 createByName ($name)
 Creates a form with given name.
 includeFile ($_file, $form, $params)
 Needed for including the form file with a clean scope.

Static Protected Attributes

static $instances = array()
 Factory instances.
static $allForms = array()
 Central storage for all forms that have been generated.


Detailed Description

The default form factory.

Searches for form files in template folders.

Definition at line 7 of file DefaultFormFactory.class.php.


Member Function Documentation

spunQ_DefaultFormFactory::createByName ( name  )  [protected]

Creates a form with given name.

If this factory is not able to create the form, it is expected to return NULL.

Parameters:
$name The name of the form to create.
Returns:
spunQ_Form Or NULL

Reimplemented from spunQ_FormFactory.

Definition at line 12 of file DefaultFormFactory.class.php.

static spunQ_FormFactory::get ( type,
array $  params = array(),
recreate = false 
) [static, inherited]

Gets the form with given name.

WARNING: The provided forms are cached, successive calls to this function with the same name will yield the same object. Provide the $recreate parameter to change this behaviour.

Parameters:
$name The name of the form to retrieve.
$params Parameters to be passed to the form factory.
$recreate Forces bypassing of the cache, re-generating the form object using its form factory. Set this to true if one of the parameters to a form have changed somehow.
Returns:
spunQ.html.Form

Definition at line 35 of file FormFactory.class.php.

static spunQ_FormFactory::getByName ( name,
recreate = false 
) [static, inherited]

Gets the form with given name.

WARNING: The provided forms are cached, successive calls to this function with the same name will yield the same object. Provide the $recreate parameter to change this behaviour.

Parameters:
$name The name of the form to retrieve.
$recreate Forces bypassing of the cache, re-generating the form object using its form factory. Set this to true if one of the parameters to a form have changed somehow.
Returns:
spunQ.html.Form

Definition at line 73 of file FormFactory.class.php.

spunQ_DefaultFormFactory::includeFile ( _file,
form,
params 
) [protected]

Needed for including the form file with a clean scope.

Parameters:
$_file The file to include.
$form The form variable for the file.
$params The variables to set.
Returns:
spunQ_Form The $form variable after the file was included.

Definition at line 80 of file DefaultFormFactory.class.php.


Member Data Documentation

spunQ_FormFactory::$allForms = array() [static, protected, inherited]

Central storage for all forms that have been generated.

The forms are mapped by their name.

Type:
map<string,spunQ.html.form>

Definition at line 21 of file FormFactory.class.php.

spunQ_FormFactory::$instances = array() [static, protected, inherited]

Factory instances.

There can be multiple form factories, each one will be requested to create the form with given name until one of them succeeeds.

Type:
array<spunQ_FormFactory>

Definition at line 14 of file FormFactory.class.php.


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

Generated on Fri Jul 1 11:12:39 2011 for spunQ3 by  doxygen 1.5.9