/** * @return string */ public function open() { $attributes = $this->fieldSet->getAttributes(); $legend = $this->fieldSet->getLabel(); $tag = sprintf('<fieldset %s><legend>%s</legend>', new Attributes($attributes), $legend); return $tag; }
/** * @inheritdoc */ public function getLabel() { return $this->element->getLabel(); }
/** * Render a fieldset * * @param \Zend\Form\FieldsetInterface $fieldset * @return string */ public function renderFieldset(FieldsetInterface $fieldset) { $legend = $fieldset->getLabel(); $attrs = $this->createFieldsetAttributes($fieldset); $markup = sprintf('<fieldset%s>', $attrs) . PHP_EOL; if ($legend && $this->isTranslatorEnabled()) { $legend = $this->getTranslator()->translate($legend, $this->getTranslatorTextDomain() ?: 'default'); } if ($legend) { $markup .= sprintf('<legend>%s</legend>', $legend); $markup .= PHP_EOL; } $markup .= $this->renderFieldsetContent($fieldset, 'fieldset'); $markup .= PHP_EOL; $markup .= '</fieldset>'; $markup .= PHP_EOL; return $markup; }