mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
BaseElement: easier way to override isVoid
This commit is contained in:
parent
20bcbdccf7
commit
5a5cd9ba1e
15
library/vendor/ipl/Html/BaseElement.php
vendored
15
library/vendor/ipl/Html/BaseElement.php
vendored
@ -32,6 +32,8 @@ abstract class BaseElement extends Html
|
|||||||
'wbr'
|
'wbr'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected $isVoid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Attributes
|
* @return Attributes
|
||||||
*/
|
*/
|
||||||
@ -165,7 +167,18 @@ abstract class BaseElement extends Html
|
|||||||
|
|
||||||
public function isVoidElement()
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user