选择省 / 市 / 区 小部件(依赖于layui)
2021-12-12更新
使用方法:
PHP Code复制内容到剪贴板
- <?= backend\widgets\choose\ChooseAreaWidget::widget(
- [
- 'province' => [
- "name" => Html::getInputName($moduleModel, "province"),
- "value" => $moduleModel->province
- ],
- 'city' => [
- "name" => Html::getInputName($moduleModel, "city"),
- "value" => $moduleModel->city
- ],
- 'district' => [
- "name" => Html::getInputName($moduleModel, "district"),
- "value" => $moduleModel->district
- ],
- ]
- ) ?>
数据表中需要建立有:province / city / district
使用方法:
PHP Code复制内容到剪贴板
- <?= ChooseCityWidget::widget(
- [
- 'province' => [
- "name" => Html::getInputName($model, "province"),
- "value" => $model->province
- ],
- 'city' => [
- "name" => Html::getInputName($model, "city"),
- "value" => $model->city
- ],
- 'district' => [
- "name" => Html::getInputName($model, "district"),
- "value" => $model->district
- ],
- ]
- ) ?>
上一篇 下拉菜单 支持按钮(单选)小部件
下一篇 V2.0版本