The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist skeeks/yii2-dadata-client "*"
or add
"skeeks/yii2-dadata-client": "*"
//App config
[
'components' =>
[
//....
'dadataClient' =>
[
'class' => 'skeeks\yii2\dadataClient\dadataClient',
'token' => 'token',
'secret' => 'secret',
'timeout' => 12,
],
//....
]
]
$response = \Yii::$app->dadataClient->suggest->address("Москва");
print_r($response); //Array response data
$response = \Yii::$app->dadataSuggestApi->detectAddressByIp(\Yii::$app->request->userIP);
$response = \Yii::$app->dadataClient->suggest->email("test@ya");
print_r($response); //Array response data
$response = \Yii::$app->dadataClient->suggest->fio("Семен");
print_r($response); //Array response data
SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | cms.skeeks.com