外观
Select联动
Select联动
php
//getCity
//其中load('city', 'getCity');的意思是,在当前select的选项切换之后,会把当前选项的值通过参数q,
//调用接口getCity(相当于Api_linadmin|getCity),并把api返回的数据填充为city选择的选项
$form->select('province')->options(...)->load('city', 'getCity');
//Api_temptest|getCity中Api_temptest为api的controller,getCity为方法
$form->select('province')->options(...)->load('city', 'Api_temptest|getCity');
$form->select('city');
//接口返回值:
$data =[
[
"id"=>9,
"text"=>"xxx"
],
[
"id"=>21,
"text"=>"xxx"
]
]
success_json($data);