diff --git a/Test/Case/View/Helper/BoostCakeFormHelperTest.php b/Test/Case/View/Helper/BoostCakeFormHelperTest.php index 424c58c..bf6f757 100644 --- a/Test/Case/View/Helper/BoostCakeFormHelperTest.php +++ b/Test/Case/View/Helper/BoostCakeFormHelperTest.php @@ -306,12 +306,12 @@ public function testRadio() { 'Name', '/legend', array('input' => array('type' => 'hidden', 'name' => 'data[name]', 'id' => 'name_', 'value' => '')), - array('label' => array('for' => 'NameOne', 'class' => 'radio')), - array('input' => array('name' => 'data[name]', 'type' => 'radio', 'value' => 'one', 'id' => 'NameOne')), + array('label' => array('for' => 'nameOne', 'class' => 'radio')), + array('input' => array('name' => 'data[name]', 'type' => 'radio', 'value' => 'one', 'id' => 'nameOne')), ' This is one', '/label', - array('label' => array('for' => 'NameTwo', 'class' => 'radio')), - array('input' => array('name' => 'data[name]', 'type' => 'radio', 'value' => 'two', 'id' => 'NameTwo')), + array('label' => array('for' => 'nameTwo', 'class' => 'radio')), + array('input' => array('name' => 'data[name]', 'type' => 'radio', 'value' => 'two', 'id' => 'nameTwo')), ' This is two', '/label', '/fieldset', diff --git a/View/Helper/BoostCakeFormHelper.php b/View/Helper/BoostCakeFormHelper.php index 73583a3..32fbc5c 100644 --- a/View/Helper/BoostCakeFormHelper.php +++ b/View/Helper/BoostCakeFormHelper.php @@ -76,6 +76,12 @@ public function input($fieldName, $options = array()) { 'afterInput' => '', 'errorClass' => 'has-error error' ); + + if (isset($options['label']) && is_string($options['label'])) { + $options['label'] = array( + 'text' => $options['label'] + ); + } $options = Hash::merge( $default,