D
D
Dmitry2014-10-10 11:22:20
Zend Framework
Dmitry, 2014-10-10 11:22:20

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

1 answer(s)
S
Shirshov Alexander, 2014-10-22
@Keanor

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 question

Ask a Question

731 491 924 answers to any question