
Public Member Functions | |
| __construct () | |
| Constructor. | |
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. | |
Static Protected Attributes | |
| static | $instances = array() |
| Factory instances. | |
| static | $allForms = array() |
| Central storage for all forms that have been generated. | |
Definition at line 6 of file FormFactory.class.php.
| spunQ_FormFactory::__construct | ( | ) |
Constructor.
Adds itself to the $instances array.
Definition at line 93 of file FormFactory.class.php.
| spunQ_FormFactory::createByName | ( | $ | name | ) | [abstract, protected] |
Creates a form with given name.
If this factory is not able to create the form, it is expected to return NULL.
| $name | The name of the form to create. |
Reimplemented in spunQ_DefaultFormFactory.
| static spunQ_FormFactory::get | ( | $ | type, | |
| array $ | params = array(), |
|||
| $ | recreate = false | |||
| ) | [static] |
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.
| $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. |
Definition at line 35 of file FormFactory.class.php.
| static spunQ_FormFactory::getByName | ( | $ | name, | |
| $ | recreate = false | |||
| ) | [static] |
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.
| $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. |
Definition at line 73 of file FormFactory.class.php.
spunQ_FormFactory::$allForms = array() [static, protected] |
Central storage for all forms that have been generated.
The forms are mapped by their name.
Definition at line 21 of file FormFactory.class.php.
spunQ_FormFactory::$instances = array() [static, protected] |
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.
Definition at line 14 of file FormFactory.class.php.
1.5.9