Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
Fixed the showLabel location and changed the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Zamponi committed Jan 29, 2017
1 parent 87ec981 commit ed42211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/TwbBundle/Form/View/Helper/TwbBundleFormRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ protected function renderElement(ElementInterface $oElement, $sLabelPosition = n
case TwbBundleForm::LAYOUT_INLINE:
if ($sElementType !== 'checkbox') {
if ($sElementType !== 'checkbox') {
if (empty($aLabelAttributes['class']) && empty($aLabelAttributes['showLabel']) ) {
if (empty($aLabelAttributes['class']) && empty($oElement->getOption('showLabel'))) {
$aLabelAttributes['class'] = 'sr-only';
} elseif (empty($aLabelAttributes['showLabel']) && !preg_match('/(\s|^)sr-only(\s|$)/', $aLabelAttributes['class'])) {
} elseif (empty($oElement->getOption('showLabel')) && !preg_match('/(\s|^)sr-only(\s|$)/', $aLabelAttributes['class'])) {
$aLabelAttributes['class'] = trim($aLabelAttributes['class'] . ' sr-only');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ public function testInlineForm()
'placeholder' => 'Enter email',
'id' => 'exampleInputEmail2'
),
'options' => array('label' => 'Email address', 'label_attributes' => [ 'showLabel' => false ],)
'options' => array('label' => 'Email address', 'showLabel' => false)
))->add(array(
'name' => 'input-email2',
'attributes' => array(
'type' => 'email2',
'placeholder' => 'Enter email2',
'id' => 'exampleInputEmail2a'
),
'options' => array('label' => 'Email address2', 'label_attributes' => [ 'showLabel' => true ],)
'options' => array('label' => 'Email address2', 'showLabel' => true)
))->add(array(
'name' => 'input-password',
'attributes' => array(
Expand Down

0 comments on commit ed42211

Please sign in to comment.