Zend Framework
3.0
|
Public Member Functions | |
__construct (FormElementManager $formElementManager=null) | |
setInputFilterFactory (InputFilterFactory $inputFilterFactory) | |
Set input filter factory to use when creating forms. | |
getInputFilterFactory () | |
Get current input filter factory. | |
setFormElementManager (FormElementManager $formElementManager) | |
Set the form element manager. | |
getFormElementManager () | |
Get form element manager. | |
create ($spec) | |
Create an element, fieldset, or form. | |
createElement ($spec) | |
Create an element. | |
createFieldset ($spec) | |
Create a fieldset. | |
createForm ($spec) | |
Create a form. | |
configureElement (ElementInterface $element, $spec) | |
Configure an element based on the provided specification. | |
configureFieldset (FieldsetInterface $fieldset, $spec) | |
Configure a fieldset based on the provided specification. | |
configureForm (FormInterface $form, $spec) | |
Configure a form based on the provided specification. | |
prepareAndInjectFieldsets ($fieldsets, FieldsetInterface $masterFieldset, $method) | |
Takes a list of fieldset specifications, creates the fieldsets, and injects them into the master fieldset. | |
Protected Member Functions | |
validateSpecification ($spec, $method) | |
Validate a provided specification. | |
prepareAndInjectElements ($elements, FieldsetInterface $fieldset, $method) | |
Takes a list of element specifications, creates the elements, and injects them into the provided fieldset. | |
prepareAndInjectObject ($objectName, FieldsetInterface $fieldset, $method) | |
Prepare and inject an object. | |
prepareAndInjectHydrator ($hydratorOrName, FieldsetInterface $fieldset, $method) | |
Prepare and inject a named hydrator. | |
prepareAndInjectFactory ($factoryOrName, FieldsetInterface $fieldset, $method) | |
Prepare and inject a named factory. | |
prepareAndInjectInputFilter ($spec, FormInterface $form, $method) | |
Prepare an input filter instance and inject in the provided form. | |
prepareAndInjectValidationGroup ($spec, FormInterface $form, $method) | |
Prepare a validation group and inject in the provided form. | |
getHydratorFromName ($hydratorName) | |
Try to pull hydrator from service manager, or instantiates it from its name. | |
getFactoryFromName ($factoryName) | |
Try to pull factory from service manager, or instantiates it from its name. | |
Protected Attributes | |
$inputFilterFactory | |
$formElementManager | |
__construct | ( | FormElementManager | $formElementManager = null | ) |
FormElementManager | $formElementManager |
configureElement | ( | ElementInterface | $element, |
$spec | |||
) |
Configure an element based on the provided specification.
Specification can contain any of the following:
ElementInterface | $element | |
array | Traversable | ArrayAccess | $spec |
Exception\DomainException |
configureFieldset | ( | FieldsetInterface | $fieldset, |
$spec | |||
) |
Configure a fieldset based on the provided specification.
Specification can contain any of the following:
FieldsetInterface | $fieldset | |
array | Traversable | ArrayAccess | $spec |
Exception\DomainException |
configureForm | ( | FormInterface | $form, |
$spec | |||
) |
Configure a form based on the provided specification.
Specification follows that of configureFieldset(), and adds the following keys:
FormInterface | $form | |
array | Traversable | ArrayAccess | $spec |
create | ( | $spec | ) |
Create an element, fieldset, or form.
Introspects the 'type' key of the provided $spec, and determines what type is being requested; if none is provided, assumes the spec represents simply an element.
array | Traversable | $spec |
Exception\DomainException |
createElement | ( | $spec | ) |
createFieldset | ( | $spec | ) |
createForm | ( | $spec | ) |
|
protected |
Try to pull factory from service manager, or instantiates it from its name.
string | $factoryName |
Exception\DomainException |
getFormElementManager | ( | ) |
Get form element manager.
|
protected |
Try to pull hydrator from service manager, or instantiates it from its name.
string | $hydratorName |
Exception\DomainException |
getInputFilterFactory | ( | ) |
Get current input filter factory.
If none provided, uses an unconfigured instance.
|
protected |
Takes a list of element specifications, creates the elements, and injects them into the provided fieldset.
array | Traversable | ArrayAccess | $elements | |
FieldsetInterface | $fieldset | |
string | $method | Method invoking this one (for exception messages) |
|
protected |
Prepare and inject a named factory.
Takes a string indicating a factory class name (or a concrete instance), try first to instantiates the class by pulling it from service manager, and injects the factory instance into the fieldset.
string | array | Factory | $factoryOrName | |
FieldsetInterface | $fieldset | |
string | $method |
Exception\DomainException | If $factoryOrName is not a string, does not resolve to a known class, or the class does not extend Form |
prepareAndInjectFieldsets | ( | $fieldsets, | |
FieldsetInterface | $masterFieldset, | ||
$method | |||
) |
Takes a list of fieldset specifications, creates the fieldsets, and injects them into the master fieldset.
array | Traversable | ArrayAccess | $fieldsets | |
FieldsetInterface | $masterFieldset | |
string | $method | Method invoking this one (for exception messages) |
|
protected |
Prepare and inject a named hydrator.
Takes a string indicating a hydrator class name (or a concrete instance), try first to instantiates the class by pulling it from service manager, and injects the hydrator instance into the form.
string | array | Hydrator\HydratorInterface | $hydratorOrName | |
FieldsetInterface | $fieldset | |
string | $method |
Exception\DomainException | If $hydratorOrName is not a string, does not resolve to a known class, or the class does not implement Hydrator |
|
protected |
Prepare an input filter instance and inject in the provided form.
If the input filter specified is a string, assumes it is a class name, and attempts to instantiate it. If the class does not exist, or does not extend InputFilterInterface, an exception is raised.
Otherwise, $spec is passed on to the attached InputFilter Factory instance in order to create the input filter.
string | array | Traversable | $spec | |
FormInterface | $form | |
string | $method |
Exception\DomainException | for unknown InputFilter class or invalid InputFilter instance |
|
protected |
Prepare and inject an object.
Takes a string indicating a class name, instantiates the class by that name, and injects the class instance as the bound object.
string | $objectName | |
FieldsetInterface | $fieldset | |
string | $method |
Exception\DomainException |
|
protected |
Prepare a validation group and inject in the provided form.
Takes an array of elements names
string | array | Traversable | $spec | |
FormInterface | $form | |
string | $method |
Exception\DomainException | if validation group given is not an array |
setFormElementManager | ( | FormElementManager | $formElementManager | ) |
setInputFilterFactory | ( | InputFilterFactory | $inputFilterFactory | ) |
Set input filter factory to use when creating forms.
InputFilterFactory | $inputFilterFactory |
|
protected |
Validate a provided specification.
Ensures we have an array, Traversable, or ArrayAccess object, and returns it.
array | Traversable | ArrayAccess | $spec | |
string | $method | Method invoking the validator |
Exception\InvalidArgumentException | for invalid $spec |
|
protected |
|
protected |