This commit is contained in:
Dave Mc Nicoll committed 2020-04-14 16:45:37 -04:00
commit b4fc4dd37f
4 files changed
+51 -22

No files matched your search

+6 -6
View File
@@ -178,7 +178,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable {
}
else if ( !is_numeric($key) ) {
# will output something like <tag $key=$value></tag>
$attributesList[] = "$key=\"$value\"";
$attributesList[] = strpos($value, '"') !== false ? "$key='$value'" : "$key=\"$value\"";
}
else {
# will output something like <tag $value></tag>
@@ -186,7 +186,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable {
}
}
$content = "";
foreach ( $this->childs as $item ) {
@@ -198,14 +198,14 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable {
}
}
if ( in_array('no-tag', $this->options) ) {
if ( in_array('no-tag', $this->options, true) ) {
return $this->content . $content;
}
else {
$compiledAttributes = (count($attributesList) && ! in_array('no-attr', $this->options) ? " " . implode(" ", $attributesList) : "");
$compiledAttributes = (count($attributesList) && ! in_array('no-attr', $this->options, true) ? " " . implode(" ", $attributesList) : "");
# Force the node to contain a certain opening tag (php is a good example)
if ( in_array('force-tag-open', $this->options) ) {
if ( in_array('force-tag-open', $this->options, true) ) {
$opentag = $this->options['force-tag-open'] . $compiledAttributes;
}
else {
@@ -217,7 +217,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable {
$closetag = "";
}
}
elseif ( in_array('force-tag-close', $this->options) ) {
elseif ( in_array('force-tag-close', $this->options, true) ) {
$closetag = $this->options['force-tag-close'];
}
else {