/** * Render a Fieldset * * @param Zend\Form\Fieldset $fieldset * @return void */ public function renderFieldset(Fieldset $fieldset) { $id = $fieldset->getAttribute('id') ?: $fieldset->getName(); return '<fieldset id="fieldset-' . $id . '">' . $this->render($fieldset) . '</fieldset>'; }
/** * Render a Fieldset * * @param \Zend\Form\Fieldset $fieldset * @return string */ public function renderFieldset(Fieldset $fieldset) { $id = $fieldset->getAttribute('id') ?: $fieldset->getName(); $class = $fieldset->getAttribute('class'); $label = $fieldset->getLabel(); if (!empty($label)) { $label = "<legend>{$label}</legend>"; } return '<fieldset id="fieldset-' . $id . '" class="' . $class . '">' . $label . $this->render($fieldset) . '</fieldset>'; }
/** * @param Fieldset $fieldset * @param boolean $groupActions * * @return HtmlElement */ protected function renderFieldset(Fieldset $fieldset, $groupActions = false) { $fieldsetElement = new HtmlElement('fieldset'); $id = $fieldset->getAttribute('id') ?: $fieldset->getName(); $parent = $this->getElement(); $fieldsetElement->addAttribute('id', $id); /** * This changes the scope of the current element, * so that the child elements (the ones that are about to be rendered), * will be set on the fieldset. * Then change it back again so that the fieldset will be added to the form. */ $this->setElement($fieldsetElement)->renderElements($fieldset, $groupActions)->setElement($parent); return $fieldsetElement; }