setContent($content); } if ($attributes !== null) { $container->setAttributes($attributes); } if ($tag !== null) { $container->setTag($tag); } return $container; } } class Old { /** * @inheritdoc */ public function render() { return $this->renderContainerFor(parent::render()); } /** * @inheritdoc */ public function renderError($error) { // TODO: eventually add class="error" return $this->renderContainerFor( parent::renderError($error) ); } /** * @param bool $render * @return $this */ public function renderIfEmpty($render = true) { $this->renderIfEmpty = $render; return $this; } /** * @param string $content * @return string */ protected function renderContainerFor($content) { return sprintf( '<%s%s>%s', $this->tag, $this->attributes->render(), $content, $this->tag ); } }