diff --git a/src/Form.php b/src/Form.php index 6a86423..ae56436 100644 --- a/src/Form.php +++ b/src/Form.php @@ -879,7 +879,7 @@ protected function renderWithoutTemplate() $label->setAttribute('for', ($name . $lblName)); $labelAttributes = $child->getLabelAttributes(); - if (null !== $labelAttributes) { + if (count($labelAttributes) > 0) { foreach ($labelAttributes as $a => $v) { if (($a == 'class') && ($child->isRequired())) { $v .= ' required'; diff --git a/src/Template/File.php b/src/Template/File.php index be9acdb..d30be6e 100644 --- a/src/Template/File.php +++ b/src/Template/File.php @@ -108,7 +108,7 @@ protected function renderTemplate() $label->setAttribute('for', $name); $labelAttributes = $child->getLabelAttributes(); - if (null !== $labelAttributes) { + if (count($labelAttributes) > 0) { foreach ($labelAttributes as $a => $v) { if (($a == 'class') && ($child->isRequired())) { $v .= ' required'; diff --git a/src/Template/Stream.php b/src/Template/Stream.php index 7789d0a..26cf3c7 100644 --- a/src/Template/Stream.php +++ b/src/Template/Stream.php @@ -103,7 +103,7 @@ protected function renderTemplate() $label->setAttribute('for', $name); $labelAttributes = $child->getLabelAttributes(); - if (null !== $labelAttributes) { + if (count($labelAttributes) > 0) { foreach ($labelAttributes as $a => $v) { if (($a == 'class') && ($child->isRequired())) { $v .= ' required';