dev-master
9999999-devYii2.0 area selecter
BSD-2-Clause
The Requires
by axlrose
extension yii2
1.0
1.0.0.0Yii2.0 area selecter
BSD-2-Clause
The Requires
by axlrose
extension yii2
Yii2.0 area selecter
Yii2.0 area selecter, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
composer require --prefer-dist echotrue/yii2-area "*"
or add, (*4)
"echotrue/yii2-area": "*"
to the require section of your composer.json
file., (*5)
Once the extension is installed, simply use it in your code by :, (*6)
Controller : public function actions() { return [ 'area' => [ 'class' => 'echotrue\area\AreaAction', 'tableName' => 'china_area', ] ]; } View: <?= $form->field($model,'name')->widget(\echotrue\area\Area::className(), [ 'model' => $model, 'options' => [ 'tableName' => 'china_area', 'url' => \yii\helpers\Url::to(['site/area']) ] ]) ?>
or, (*7)
Controller : public function actions() { return [ 'area' => [ 'class' => 'echotrue\area\AreaAction', 'tableName' => 'china_area', ] ]; } View: echo \echotrue\area\Area::widget([ 'name' => 'name', 'options' => [ 'tableName' => 'china_area', 'url' => \yii\helpers\Url::to(['site/area']) ] ]);
options:
- tableName
: The table'name of the area source,without table prefix
- url
: The request url for inline actions .
- template
: default template like this , maybe you can customize your template, (*8)
{hideInput}{province}{city}{regional}
Yii2.0 area selecter
BSD-2-Clause
extension yii2
Yii2.0 area selecter
BSD-2-Clause
extension yii2