Added rule for "hidden" field

This commit is contained in:
Benjamin Beganović 2020-08-10 16:43:25 +02:00
parent 2f40804568
commit 20591bc251

View File

@ -67,7 +67,7 @@ trait PdfMakerUtilities
{
$processed = [];
foreach($children as $child) {
foreach ($children as $child) {
if (!isset($child['order'])) {
$child['order'] = 0;
}
@ -84,6 +84,14 @@ trait PdfMakerUtilities
public function updateElementProperty($element, string $attribute, string $value)
{
// We have exception for "hidden" property.
// hidden="true" or hidden="false" will both hide the element,
// that's why we have to create an exception here for this rule.
if ($attribute == 'hidden' && ($value == false || $value == "false")) {
return $element;
}
$element->setAttribute($attribute, $value);
if ($element->getAttribute($attribute) === $value) {