0
通過使用鋰形式助手,我們可以插入一個select
標籤,可以選擇單個項目。鋰:正確使用select2與`multiple`選項
樣本:
echo $this->form->field('myfield', array(
'type' => 'select',
'list' => array(
'id1' => 'value1',
'id2' => 'value2',
),
)
);
現在,如果你想使用Select2
jQuery插件與multiple
選項,在form helper
嘗試field
方法檢索字符串提交的值。 即使設置了multiple
選項!
非工作樣品:
echo $this->form->field('myfield', array(
'type' => 'select',
'list' => array(
'id1' => 'value1',
'id2' => 'value2',
),
'multiple' => true,
)
);