2017 © Pedro Peláez
 

yii2-extension yii2-area

Yii2.0 area selecter

image

echotrue/yii2-area

Yii2.0 area selecter

  • Thursday, December 22, 2016
  • by echotrue
  • Repository
  • 1 Watchers
  • 1 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2.0 area selecter

Yii2.0 area selecter, (*1)

Installation

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)

Usage

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'])
        ]
    ]);

configuration

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}

The Versions

22/12 2016

dev-master

9999999-dev

Yii2.0 area selecter

  Sources   Download

BSD-2-Clause

The Requires

 

by axlrose

extension yii2

22/12 2016

1.0

1.0.0.0

Yii2.0 area selecter

  Sources   Download

BSD-2-Clause

The Requires

 

by axlrose

extension yii2