Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'patch-4' of https://github.com/adamlundrigan/zf2-docume…

…ntation into hotfix/332
  • Loading branch information...
commit 44934944ae8e974d419796a77e5f466f66e93970 2 parents d46d34f + 691d54a
@weierophinney weierophinney authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 docs/languages/en/user-guide/forms-and-actions.rst
View
13 docs/languages/en/user-guide/forms-and-actions.rst
@@ -303,6 +303,19 @@ but for the two elements that are standalone, we use ``formHidden()`` and
.. image:: ../images/user-guide.forms-and-actions.add-album-form.png
:width: 940 px
+Alternatively, the process of rendering the form can be simplified by using the
+bundled ``formCollection`` view helper. For example, in the view script above replace
+all the form-rendering echo statements with:
+
+.. code-block:: php
+
+ echo $this->formCollection($form);
+
+This will iterate over the form structure, calling the appropriate label, element
+and error view helpers for each element, and wrap the result in open and close form tags.
+This helps reduce the complexity of your view script in situations where the default
+HTML rendering of the form is acceptable.
+
You should now be able to use the “Add new album” link on the home page of the
application to add a new album record.
Please sign in to comment.
Something went wrong with that request. Please try again.