diff --git a/src/TwbBundle/Form/View/Helper/TwbBundleFormRadio.php b/src/TwbBundle/Form/View/Helper/TwbBundleFormRadio.php index 031fae2..349039c 100644 --- a/src/TwbBundle/Form/View/Helper/TwbBundleFormRadio.php +++ b/src/TwbBundle/Form/View/Helper/TwbBundleFormRadio.php @@ -46,9 +46,15 @@ public function render(ElementInterface $oElement) return $sReturn; } - if (isset($aElementOptions['btn-group']) && $aElementOptions['btn-group'] == true) { + if (isset($aElementOptions['btn-group']) && $aElementOptions['btn-group'] != false) { + + $buttonClass = 'btn btn-primary'; + if (is_array($aElementOptions['btn-group']) && isset($aElementOptions['btn-group']['btn-class'])) { + $buttonClass = $aElementOptions['btn-group']['btn-class']; + } + $this->setSeparator(''); - $oElement->setLabelAttributes(array('class' => 'btn btn-primary')); + $oElement->setLabelAttributes(array('class' => $buttonClass)); return sprintf('
%s
', parent::render($oElement)); }