From 5a5cd9ba1e2a51cd84da1620e0fed12ed45bf673 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 20 Feb 2018 14:38:32 +0100 Subject: [PATCH] BaseElement: easier way to override isVoid --- library/vendor/ipl/Html/BaseElement.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/library/vendor/ipl/Html/BaseElement.php b/library/vendor/ipl/Html/BaseElement.php index dd3beae3..486fe59c 100644 --- a/library/vendor/ipl/Html/BaseElement.php +++ b/library/vendor/ipl/Html/BaseElement.php @@ -32,6 +32,8 @@ abstract class BaseElement extends Html 'wbr' ]; + protected $isVoid; + /** * @return Attributes */ @@ -165,7 +167,18 @@ abstract class BaseElement extends Html public function isVoidElement() { - return in_array($this->tag, self::$voidElements); + if ($this->isVoid === null) { + $this->isVoid = in_array($this->tag, self::$voidElements); + } + + return $this->isVoid; + } + + public function setVoid($void = true) + { + $this->isVoid = $void; + + return $this; } /**