Developing software in the Real World

Creating a ZF2 form from config

I have a requirement to create a Zend\Form from a dynamically created array which means that I can’t use the FormAbstractServiceFactory and so will use Zend\Form\Factory directly.

If you need to override any form elements, validators or add new ones, then you’ll need the correct plugin managers for the factory. The way to set this up is like this:

Your $factory is now configured and so you can create a form like this: