예제 #1
0
파일: FieldSet.php 프로젝트: hanif/stokq
 /**
  * @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;
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function getLabel()
 {
     return $this->element->getLabel();
 }
예제 #3
0
파일: Form.php 프로젝트: gridguyz/zork
 /**
  * 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;
 }