golmschenk
golmschenk

Reputation: 12384

CakePHP 1.3 - Radio label without legend?

In CakePHP 1.3 for most form inputs I'm able to add a label with the option 'label' => 'MyLabel', however the radio button input works a bit differently. It uses a legend and fieldset to organize the buttons and the label for the buttons. Is there a way to remove the legend and fieldset (using 'legend => false') while at the same time adding the regular label that most other input use? Specifically in the same format that the other inputs do it? For example, something like:

$this->Form->input('active1', array('type' => 'radio', 'options' => array(1=>'Yes', 0=>'No'), 'label' => 'Active', 'legend' => false));

This however completely removes the label. Is there a way to leave the label in with an option? Or do I have to create a custom function to do this for me? Thank you much!

Upvotes: 0

Views: 1280

Answers (1)

George Cummins
George Cummins

Reputation: 28906

There is not a way to use the standard label option with a radio button, but it is easy to add in your view without the use of a custom function:

<label>MyLabel</label>
<?php echo $this->Form->radio('...

Upvotes: 1

Related Questions