Beispiel #1
0
 /**
  * Renders a group of radio buttons
  *
  * @param  Render $renderer
  *
  * @return string
  *
  * @since 2.0
  */
 public function render(Render $renderer)
 {
     $radios = [];
     foreach ($this->getContents() as $radio) {
         $radios[] = $renderer->render($radio);
     }
     return implode('', $radios);
 }
Beispiel #2
0
 /**
  * Should return a html string that represents the rendered object
  *
  * @param Render $renderer
  *
  * @return string
  *
  * @since 2.0
  */
 public function render(Render $renderer)
 {
     $elements = '';
     foreach ($this->getContents() as $element) {
         $elements .= "\n" . $renderer->render($element);
     }
     return Html::tag('form', $this->getAttributes(), $elements);
 }
Beispiel #3
0
 /**
  * Renders out an optgroup and any child options
  *
  * @param Render $renderer
  *
  * @return string
  *
  * @since 2.0
  */
 public function render(Render $renderer)
 {
     $content = '';
     foreach ($this->getContents() as $option) {
         $content .= "\n" . $renderer->render($option);
     }
     return Html::tag('optgroup', $this->getAttributes(), $content);
 }
Beispiel #4
0
 /**
  * Renders a group of checkboxes to html
  *
  * @param Render $renderer
  *
  * @return string
  *
  * @since 2.0
  */
 public function render(Render $renderer)
 {
     $checkboxes = [];
     // Render all the boxes
     foreach ($this->getContents() as $checkbox) {
         $checkboxes[] = $renderer->render($checkbox);
     }
     return implode('', $checkboxes);
 }
Beispiel #5
0
 /**
  * Renders the Fieldset to html
  *
  * @param  Render $renderer
  *
  * @return string
  *
  * @since 2.0
  */
 public function render(Render $renderer)
 {
     $legend = '';
     //Make sure the legend is added if needed
     if (!is_null($this->getLegend())) {
         $legend = Html::tag('legend', [], $this->getLegend());
     }
     //Makes sure the legend is added if one exists
     $elements = $legend;
     //Render all the elements
     foreach ($this->getContents() as $element) {
         $elements .= "\n" . $renderer->render($element);
     }
     return Html::tag('fieldset', $this->getAttributes(), $elements);
 }