Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skeeks-semenov/yii2-dadata-client
https://dadata.ru/api/#address
https://github.com/skeeks-semenov/yii2-dadata-client
Last synced: about 13 hours ago
JSON representation
https://dadata.ru/api/#address
- Host: GitHub
- URL: https://github.com/skeeks-semenov/yii2-dadata-client
- Owner: skeeks-semenov
- License: bsd-3-clause
- Created: 2020-10-22T06:51:31.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-05T12:57:06.000Z (about 2 years ago)
- Last Synced: 2024-09-08T16:45:16.534Z (17 days ago)
- Language: PHP
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
API Dadata.ru
===================================Info
------------
* https://dadata.ru/api/Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist skeeks/yii2-dadata-client "*"
```or add
```
"skeeks/yii2-dadata-client": "*"
```How to use
----------```php
//App config
[
'components' =>
[
//....
'dadataClient' =>
[
'class' => 'skeeks\yii2\dadataClient\dadataClient',
'token' => 'token',
'secret' => 'secret',
'timeout' => 12,
],
//....
]
]```
Examples
----------### Адресные подсказки
```php
$response = \Yii::$app->dadataClient->suggest->address("Москва");
print_r($response); //Array response data
```### Определение положения пользователя по ip
```php
$response = \Yii::$app->dadataSuggestApi->detectAddressByIp(\Yii::$app->request->userIP);
```### Подсказки email
```php
$response = \Yii::$app->dadataClient->suggest->email("test@ya");
print_r($response); //Array response data
```### Подсказки фио
```php
$response = \Yii::$app->dadataClient->suggest->fio("Семен");
print_r($response); //Array response data
```___
> [![skeeks!](https://skeeks.com/img/logo/logo-no-title-80px.png)](https://skeeks.com)
SkeekS CMS (Yii2) — quickly, easily and effectively!
[skeeks.com](https://skeeks.com) | [cms.skeeks.com](https://cms.skeeks.com)