PHP code example of qingbing / pf-widgets-china-area

1. Go to this page and download the library: Download qingbing/pf-widgets-china-area library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

qingbing / pf-widgets-china-area example snippets


 $this->widget('\Widgets\ChinaArea', [
    'name' => 'aaaa',
    'defaultCode' => '820000',
]); 

 $this->widget('\Widgets\ChinaArea', [
    'model' => $model,
    'name' => 'aaaa',
]); 

$code = $this->getApp()->getRequest()->getParam('code');
$info = \Tools\ChinaArea::getAreaInfo($code);
var_dump($info);
$address = \Tools\ChinaArea::getAddress($code);
var_dump($address);