skeeks / yii2-webinar-client
https://help.webinar.ru/ru/collections/1839571-api
1.0.0
2021-06-15 09:59 UTC
Requires
README
信息
安装
通过 composer 安装此扩展是首选方式。
运行以下命令之一:
php composer.phar require --prefer-dist skeeks/yii2-dadata-client "*"
或者添加
"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
通过IP确定用户位置
$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) — 快速、简单、高效!
skeeks.com | cms.skeeks.com