Matthimatiker / MolComponents

Library with use-at-will architecture that extends the functionality of Zend Framework 1. Main features: Improved bootstrapping with lazy loading of resources, declaration of request parameters as argument in controller actions, advanced form creation and validation, mail templates, lightweight controller testing.
Other
2 stars 0 forks source link

Create a form factory #17

Closed Matthimatiker closed 12 years ago

Matthimatiker commented 12 years ago

Create a factory that is able to create form instances (Zend_Form or subclasses).

The factory should be able to inject elements like captchas or CSRF tokens if requested. These elements provide additional security, but both are hard to test automatically and do not add business functionality to forms. Therefore it would be convenient if it is not required to add them to form instances manually. That allows us to test forms without these elements.

Matthimatiker commented 12 years ago

Created Mol_Form_Factory whose create() method is able to instantiate forms by class name. Additionally, factory plugins can be added, which are used to enhance the created forms.

Issue #26 deals with a factory plugin that injects CSRF tokens into created forms. Although planned before, this functionality will not be implemented in the factory directly.