PHP code example of sparkinzy / dcat-distpicker

1. Go to this page and download the library: Download sparkinzy/dcat-distpicker 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/ */

    

sparkinzy / dcat-distpicker example snippets


$form->distpicker(['province_name', 'city_name', 'district_name'])->autoselect(1);

$form->distpicker(['province_name', 'city_name', 'district_name']))->select2();

# province_name 为字段名
$filter->distpicker(['province_name', 'city_name', 'district_name'], '地域选择');



$filter->distpicker(['province_name', 'city_name', 'district_name'], '地域选择')
->level();


$filter->distpicker(['province_name', 'city_name', 'district_name'], '地域选择')
->level(2);

$filter->distpicker(['province_name', 'city_name', 'district_name'], '地域选择')->type('code');
# 只进行省市筛选
$filter->distpicker(['province_name', 'city_name', 'district_name'], '地域选择')->level(2)->type('code');