Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 6
0
 /**
  * @param CSRFProvider $csrf
  *
  * @since 2.0
  */
 public function __construct(CSRFProvider $csrf = null)
 {
     parent::__construct($csrf);
     $this->table = new Table();
 }