I carefully studied the previous questions, and I am surprised that no one has asked about this yet, because it seems pretty simple.
How to make my shortcuts wrapped in inputs as well as label text using CakePHP FormHelper? I am using CakePHP 2.3.1. Calling $this->Form->radio() with some standard options gives:
<input id="input_id" type="radio" ... /> <label for="input_id">label text</label>
What I'm looking for
<label for="input_id"><input type="radio" id="input_id" ... />label text</label>
I used this method:
$this->Form->input('input1',array('options'=>$options,'type'=>'radio', 'label'=>false 'before'=>'<label>', 'separator'=>'</label><label>', 'after'=>'</label>' ));
But, obviously, this solution is not ideal. Can someone tell me if CakePHP has an easier and more βcorrectβ way to achieve this?
source share