CakePHP label option on input select form not working as expected -
my select form working perfectly, label not display no matter variation or arrangement of arguments.
here code:
<?php echo $this->form->input('plan_detail_id', $plans_list, array( 'type' => 'select', 'label' => 'select plan detail', 'empty' => '-- select plan detail --' )); ?>
as can see have second argument $plan_list
place label tag. example, of other labels such ok:
<td><?php echo $this->form->input('age_id', array( 'label' => 'select age range', 'empty' => '-- select age range --' )); ?></td>
note: there no second $argument
first example. doing totally wrong? or not possible or bug?
the api doesn't show 3 parameters formhelper::input
method; there $fieldname
, $options
. meant use formhelper::select
method instead.
$this->form->select('plan_detail_id', $plans_list, null, array('label' => 'select plan detail', 'empty' => '-- select plan detail --'));
note formhelper::select
not include wrapping <div>
or label. must pass in this..
echo $this->form->input( 'plan_detail_id', array( 'options' => $plans_list, 'type' => 'select', 'empty' => '-- select plan detail --', 'label' => 'select plan detail' ) );
this differs original attempt in moves $plans_list
array options
argument set.
Comments
Post a Comment