isudakoff / yii2-dadata-suggestions
Yii2 DaData Suggestions
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-10-29 05:16:03 UTC
README
This extension allows you to easily get tips from service DaData.ru
Installation
The preferred way to install this extension is through composer.
Run
php composer.phar require --prefer-dist isudakoff/yii2-dadata-suggestions "*"
or add
"isudakoff/yii2-dadata-suggestions": "*"
to the require
section of your composer.json.
Usage
Add to config:
'components' => [ // ... 'dadata' => [ 'class' => 'isudakoff\dadata\Suggest', 'token' => 'your_token_here', ], ]
Get array of Address where needed
$addresses = Yii::$app->dadata->getAddresses('москва проспект мира 10', 10); $street = $addresses[0]->street $city = $addresses[0]->city $country = $addresses[0]->country
TBD
- Add more types of suggestion
- Add docs