Instead of the Zend Framework 1 Decorators (where it was a key in the creation and rendering of forms) we now know in Zend Framework 2 that it is better to use different view helpers and renderers to render the forms.
View helpers are very important tools to a developer, here we will discuss how to use them in our code.
We do the following alterations to a view script called
<?php // Just open and close the form tag echo $this->form()->openTag(); echo $this->form()->closeTag(); // Use a form to pull the attributes from echo $this->form()->openTag($formObject); /** Do stuff in between **/ // Close the tag again with no form object attached echo $this->form->closeTag();
The rendered ...