Skip to content

Commit

Permalink
Patch required class for element label
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksagona committed Mar 25, 2016
1 parent 119a7c3 commit 9a47a09
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/Template/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 9a47a09

Please sign in to comment.