getElement(); if ((!$form instanceof Zend_Form) && (!$form instanceof Zend_Form_DisplayGroup)) { return $content; } $firstSubForm = current($form->getSubForms()); if (!($firstSubForm instanceof Qs_Form_SubForm)) { return $content; } $elementContent = ''; $separator = $this->getSeparator(); $translator = $form->getTranslator(); $items = []; $view = $form->getView(); /** @var Qs_Form_Decorator_HtmlTag $th */ $th = (new Qs_Form_Decorator_HtmlTag())->setElement($this->getElement())->setTag('th'); /** @var Qs_Form_Decorator_HtmlTag $label */ $label = (new Qs_Form_Decorator_HtmlTag())->setElement($this->getElement())->setTag('label'); /** @var Zend_Form_Element $element */ foreach ($firstSubForm->getElements() as $element) { $element->setView($view)->setTranslator($translator); if (($decorator = $element->getDecorator('HtmlTag')) && ($class = $decorator->getOption('class'))) { $th->setOption('class', $class); } if ($element->isRequired()) { $label->setOption('class', 'required'); } $items[] = $th->render($label->render($view->escape($element->getLabel()))); } $elementContent .= implode($separator, $items); switch ($this->getPlacement()) { case self::PREPEND: return $elementContent . $separator . $content; case self::APPEND: default: return $content . $separator . $elementContent; } } }