Skip to content

Commit

Permalink
<span>$label</span> only when filled
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Sep 20, 2012
1 parent afac243 commit 984e30c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions library/Zend/Form/View/Helper/FormRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,17 @@ public function render(ElementInterface $element)
$labelClose = $labelHelper->closeTag();
}

if (!empty($label)) {
$label = '<span>' . $label . '</span>';
}

switch ($this->labelPosition) {
case self::LABEL_PREPEND:
$markup = $labelOpen . '<span>' . $label . '</span>' . $elementString . $labelClose;
$markup = $labelOpen . $label . $elementString . $labelClose;
break;
case self::LABEL_APPEND:
default:
$markup = $labelOpen . $elementString . '<span>' . $label . '</span>' . $labelClose;
$markup = $labelOpen . $elementString . $label . $labelClose;
break;
}

Expand Down

0 comments on commit 984e30c

Please sign in to comment.