Answer the question
In order to leave comments, you need to log in
How to properly define a form object in Zend Framework 2?
How, or rather where, to define a form object that should be available on any page of the site ("callback"), without creating an object of this form in each controller / action?
Answer the question
In order to leave comments, you need to log in
The form can be created by a separate class, and can be obtained anywhere from the ServiceManager via the FormElementManager.
An example of receiving in any controller:
where ModuleName\Form\MyForm is the full class name of the form (including namespace)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question