rowe/yii2-region
Composer 安装命令:
composer require rowe/yii2-region
包简介
Yii2中国省市区三级联动
README 文档
README
This is an Yii2 widget for Chinese region list field. (https://github.com/rowe/yii2-region)
Demo
Installation
Add to composer.json file with:
"rowe/yii2-region": "dev-master"
Configuration
Copy the @rowe/yii2-region/src/migrations/m170621_032947_region.php to the migration folder like console/migrations. Run
"Yii migrate"
The region codes would be inserted via Yii migration
Usage
Firstly, bind the behavior to your model which need to use the region fields.
public function behaviors() { return [ 'RegionBehavior' => [ 'class' => RegionBehavior::className(), ] ]; }
And then, use the widget in the view.
<?= RegionWidget::widget(['model' => $model]);?>
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-07-17
