public function render() { $content = $this->getContent() ? $this->getContent() : $this->element->renderPartial(); $this->setContent(''); switch ($this->placement) { case self::PLACEMENT_AFTER: $this->setContent($this->element->getLabel()); $html = $content . parent::render(); break; case self::PLACEMENT_WRAP: $this->setContent($content); $html = parent::render(); break; case self::PLACEMENT_APPEND: $this->setContent($this->element->getLabel() . ' ' . $content); $html = parent::render(); break; case self::PLACEMENT_PREPEND: $this->setContent($content . ' ' . $this->element->getLabel()); $html = parent::render(); break; case self::PLACEMENT_BEFORE: default: $this->setContent($this->element->getLabel()); $html = parent::render() . $content; } return $html; }
public function render() { $this->setContent($this->element->renderPartial()); if ($this->prependAddon) { $this->prepend($this->prependAddon->render()); } if ($this->appendAddon) { $this->append($this->appendAddon->render()); } return parent::render(); }
public function render() { $content = $this->element->renderPartial(); if ($this->element->getHelp()) { $this->setContent($this->element->getHelp()); } if (!$this->getContent()) { return $content; } switch ($this->placement) { case self::PLACEMENT_BEFORE: $html = parent::render() . $content; break; default: case self::PLACEMENT_AFTER: $html = $content . parent::render(); } return $html; }
/** * * @param mixed $content * @param mixed $options */ public function __construct($content = '', $options = null) { parent::__construct('div', $content, $options); }