From c56c66d19387ebf0085a4a51c5510fe0b34400d9 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 28 Nov 2016 23:50:29 +0100 Subject: [PATCH] BaseElement: add createElement helper --- library/Businessprocess/Html/BaseElement.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/Businessprocess/Html/BaseElement.php b/library/Businessprocess/Html/BaseElement.php index 15fd81e..b00c42a 100644 --- a/library/Businessprocess/Html/BaseElement.php +++ b/library/Businessprocess/Html/BaseElement.php @@ -68,6 +68,21 @@ abstract class BaseElement extends Html return $this->tag; } + /** + * Container constructor. + * + * @param string $tag + * @param Attributes|array $attributes + * + * @return Element + */ + public function createElement($tag, $attributes = null) + { + $element = Element::create($tag, $attributes); + $this->add($element); + return $element; + } + public function renderContent() { return parent::render();