如何获取 bootstrap.widgets.TbSelect2 在数组中显示的值..
这是我的代码:
$employees = Employee::model()->findAll();
$ctr = 0;
$emp = '';
foreach($employees as $emps){
$emp[$ctr]=$emps['id'].". ".$emps['lastname']." ".$emps['firstname'];
$ctr++;
}
$this->widget(
'bootstrap.widgets.TbSelect2',
array(
'asDropDownList' => false,
'name' => 'emp_sel',
'options' => array(
'tags' => $emp,
'placeholder' => 'Type the name of employee and press enter to select',
'width' => '100%',
'tokenSeparators' => array(',', ' ')
)
)
);
?>
谢谢