My select form is working perfectly, but my label will not display no matter the variation or arrangement of arguments.
Here is my code:
<?php echo $this->Form->input('plan_detail_id', $plans_list, array(
'type' => 'select',
'label' => 'Select a the Plan Detail',
'empty' => '-- Select a the Plan Detail --'
)); ?>
As you can see I have a second argument $plan_list which is normally the place for the label tag. For example, all of my other labels like such are OK:
<td><?php echo $this->Form->input('age_id', array(
'label' => 'Select an Age Range',
'empty' => '-- Select an Age Range --'
)); ?></td>
Note: there is no second $argument like the first example. Am I doing something totally wrong? Or is this not possible or a bug?
The API doesn’t show three parameters to the
FormHelper::inputmethod; there is only$fieldNameand$options. You probably meant to use theFormHelper::selectmethod instead.Note that the
FormHelper::selectdoes not include a wrapping<div>or label. To do so you must pass in something like this..This differs from your original attempt in that it moves the
$plans_listinto the array with theoptionsargument set.