src/Form/View/Helper/FormCollectionContainer.php
public function render(CollectionContainer $container, $layout = Form::LAYOUT_HORIZONTAL, $parameter = [])
    {
        $view = $this->getView();
        $view->headscript()
            ->appendFile($view->basepath('modules/Core/js/jquery.formcollection-container.js'));
        $translator = $this->getTranslator();
        $formContainerHelper = $view->formContainer();
        $formsMarkup = '';
        $formTemplateWrapper = '<div class="form-collection-container-form">
            '. ($this->displayRemoveButton ? '<button type="button" class="btn btn-sm btn-danger pull-right form-collection-container-remove-button">' . $translator->translate('Remove') . '</button>' : '') . '
            %s
        </div>';
        
        foreach ($container as $form) /* @var $form \Zend\Form\Form */
        {
            $formsMarkup .= sprintf($formTemplateWrapper, $formContainerHelper->renderElement($form, $layout, $parameter));
        }
        
        $templateForm = $container->getTemplateForm();
        $templateMarkup = sprintf(
            $view->formCollection()->getTemplateWrapper(),
            $view->escapeHtmlAttr(sprintf($formTemplateWrapper, $formContainerHelper->renderElement($templateForm, $layout, $parameter)))
        );
        
        return sprintf(
            '<div class="form-collection-container" data-new-entry-key="%s" data-remove-action="%s" data-remove-question="%s">
                <h3>%s</h3>
                %s%s%s
            </div>',
            CollectionContainer::NEW_ENTRY,
            $container->formatAction('remove'),
            $translator->translate('Really remove?'),
            $container->getLabel(),
            $formsMarkup,
            $templateMarkup,
            '<div class="form-collection-container-add-wrapper"><button type="button" class="btn btn-success form-collection-container-add-button"><span class="yk-icon yk-icon-plus"></span> ' . sprintf($translator->translate('Add %s'), $container->getLabel()) . '</button></div>'
        );
    }
public function render(CollectionContainer $container, $layout = Form::LAYOUT_HORIZONTAL, $parameter = [])
    {
        $view = $this->getView();
        $view->headscript()
            ->appendFile($view->basepath('modules/Core/js/jquery.formcollection-container.js'));
        $translator = $this->getTranslator();
        $formContainerHelper = $view->formContainer();
        $formsMarkup = '';
        $formTemplateWrapper = '<div class="form-collection-container-form">
            '. ($this->displayRemoveButton ? '<button type="button" class="btn btn-sm btn-danger pull-right form-collection-container-remove-button">' . $translator->translate('Remove') . '</button>' : '') . '
            %s
        </div>';
        
        foreach ($container as $form) /* @var $form \Zend\Form\Form */
        {
            $formsMarkup .= sprintf($formTemplateWrapper, $formContainerHelper->renderElement($form, $layout, $parameter));
        }
        
        $templateForm = $container->getTemplateForm();
        $templateMarkup = sprintf(
            $view->formCollection()->getTemplateWrapper(),
            $view->escapeHtmlAttr(sprintf($formTemplateWrapper, $formContainerHelper->renderElement($templateForm, $layout, $parameter)))
        );
        
        return sprintf(
            '<div class="form-collection-container" data-new-entry-key="%s" data-remove-action="%s" data-remove-question="%s">
                <h3>%s</h3>
                %s%s%s
            </div>',
            CollectionContainer::NEW_ENTRY,
            $container->formatAction('remove'),
            $translator->translate('Really remove?'),
            $container->getLabel(),
            $formsMarkup,
            $templateMarkup,
            '<div class="form-collection-container-add-wrapper"><button type="button" class="btn btn-success form-collection-container-add-button"><span class="yk-icon yk-icon-plus"></span> ' . sprintf($translator->translate('Add %s'), $container->getLabel()) . '</button></div>'
        );
    }
Renders the forms of a container.

@param CollectionContainer $container
@param string $layout
@param array $parameter
@return string