<div class="layui-input-inline">
<div id="demo1"></div>
</div>
JS:
var demo1 = xmSelect.render({
el: '#demo1',
language: 'zn',
data: [
{volist name="port" id="v"}
{name: '{$v.name}', value: '{$v.value}'},
{/volist}
]
})
controller:
View::assign('port', get_cks_port());
return view();
common
function get_cks_port(){
// $result ="{name: '张三', value: 1}, {name: '李四', value: 2}, {name: '王ERWER', value: 3} ";
$port = Db::name('port')
->field("portcode value,cname name")
->select()->toArray();
return $port;
};