skeeks/yii2-webinar-client

https://help.webinar.ru/ru/collections/1839571-api

安装: 0

依赖: 0

建议者: 0

安全性: 0

星星: 0

关注者: 2

分支: 0

类型:yii2-extension

1.0.0 2021-06-15 09:59 UTC

This package is auto-updated.

Last update: 2024-09-15 16:40:15 UTC


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!
SkeekS CMS (Yii2) — 快速、简单、高效!
skeeks.com | cms.skeeks.com