Last active
December 20, 2015 21:18
-
-
Save aronkerr/6196208 to your computer and use it in GitHub Desktop.
Get individual form elements from ZF2 collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Itterate over the collection and grap the elements | |
foreach($form->get('collectionName')->getIterator() as $fieldset) | |
{ | |
echo $this->formRow($fieldset->get('elementName')); | |
echo $this->formRow($fieldset->get('elementAnotherElementName')); | |
} | |
// Render the collection template | |
echo $this->formCollection()->renderTemplate($form->get('collectionName')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the parentheses are missing in l. 15 for formCollection() view helper.