alexeevdv / carrot-quest-yii2-client

carrot-quest-php-client 的 Yii2 组件

0.1.0 2019-12-14 11:06 UTC

This package is auto-updated.

Last update: 2024-09-14 21:54:43 UTC


README

Build Status codecov PHP 7.1 PHP 7.2 PHP 7.3 PHP 7.4

carrot-quest-php-client 的 Yii2 组件

安装

安装此扩展的首选方式是通过 composer.

运行以下命令之一:

$ php composer.phar require alexeevdv/carrot-quest-yii2-client "^0.1"

或者

"alexeevdv/carrot-quest-yii2-client": "^0.1"

将以下内容添加到您的 composer.json 文件的 require 部分:

配置

[
    'components' => [
        'carrotQuest' => [
            'class' => alexeevdv\yii\CarrotQuest\Client::class,
            'authToken' => 'MY_AUTH_TOKEN',
        ],
    ],
]

[
    'container' => [
        'singletons' => [
            alexeevdv\CarrotQuest\ClientInterface::class => [
                'class' => alexeevdv\yii\CarrotQuest\Client::class,
                'authToken' => 'MY_AUTH_TOKEN',
            ],
        ],
    ],
]

用法

Yii::$app->carrotQuest->userSetProperties(777, ['$name' => 'John'], false);

方法

有关可用方法的列表,请参阅 https://github.com/alexeevdv/carrot-quest-php-client