src/Form/View/Helper/FormRowCombined.php
public function render(array $elements)
    {
        $formRowHelper = $this->getFormRowHelper();
        $labels = array();
        $markups = '';
        $totalSpanWidth = 0;
        foreach ($elements as $spanWidth => $element) {
            $elementErrors = $element->getMessages();
            $markup = $formRowHelper->render($element);
            if (preg_match('~<label.*</label>~isU', $markup, $match)) {
                $labels[] = $match[0];
                $markup = str_replace($match[0], '', $markup);
            } else {
                //$labels[] = false;
            }
            $markups .= sprintf(
                '<div class="col-md-%d%s">%s</div>',
                $spanWidth,
                empty($elementErrors) ? '' : ' input-error',
                $markup
            );
            $totalSpanWidth += $spanWidth;
        }
        $labelSpanWidth = 12 - $totalSpanWidth;
        
        $labelMarkup = sprintf(
            '<div class="col-md-%d yk-label">%s</div>',
            $labelSpanWidth,
            implode(' / ', $labels)
        );
        
        $form_row_class = 'row';
        if ($this->layout == 'form-horizontal') {
            $form_row_class = 'form-group';
        }
        
        
        return sprintf(
            '<div class="controls controls-row ' . $form_row_class . '">%s%s</div>',
            $labelMarkup,
            $markups
        );
    }
public function render(array $elements)
    {
        $formRowHelper = $this->getFormRowHelper();
        $labels = array();
        $markups = '';
        $totalSpanWidth = 0;
        foreach ($elements as $spanWidth => $element) {
            $elementErrors = $element->getMessages();
            $markup = $formRowHelper->render($element);
            if (preg_match('~<label.*</label>~isU', $markup, $match)) {
                $labels[] = $match[0];
                $markup = str_replace($match[0], '', $markup);
            } else {
                //$labels[] = false;
            }
            $markups .= sprintf(
                '<div class="col-md-%d%s">%s</div>',
                $spanWidth,
                empty($elementErrors) ? '' : ' input-error',
                $markup
            );
            $totalSpanWidth += $spanWidth;
        }
        $labelSpanWidth = 12 - $totalSpanWidth;
        
        $labelMarkup = sprintf(
            '<div class="col-md-%d yk-label">%s</div>',
            $labelSpanWidth,
            implode(' / ', $labels)
        );
        
        $form_row_class = 'row';
        if ($this->layout == 'form-horizontal') {
            $form_row_class = 'form-group';
        }
        
        
        return sprintf(
            '<div class="controls controls-row ' . $form_row_class . '">%s%s</div>',
            $labelMarkup,
            $markups
        );
    }
Utility form helper that renders a label (if it exists), an element and errors

@param ElementInterface $elements
@return string
@throws \Zend\Form\Exception\DomainException