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