【发布时间】:2014-01-30 03:42:51
【问题描述】:
您好,我有一个名为 $crit 的数组,我在其中放置了 HTML 表单组件的值
例如这个输入:
{{ Form::label('name', 'Name:', array('class'=>'label'))}}
{{ Form::text('name', isset($criteria['name'])?$crit['name']:'', array('id'=>'name', 'class'=>'input'))}}<br/>
我想对 select 组件做同样的事情,但我不知道如何将所选性别的值添加到我的 $crit 数组中。
{{Form::label('Sex', 'Sex:', array('class'=>'label'))}}
{{Form::select('sex', $options, 'M', array('id'=>'sex'))}}
在我看来,我已经定义了数组$options
public function get_index()
{
return View::make('personal.data')
->with('options', array('M' => 'Male', 'F' => 'Female'))
}
感谢您的回答,问候
【问题讨论】: