v3toys/yii2-api

This package is abandoned and no longer maintained. The author suggests using the v3toys/yii2-api package instead.

V3toys yii2 api

Installs: 214

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Type:yii2-extension

2.0.1 2019-03-14 11:20 UTC

This package is auto-updated.

Last update: 2022-02-01 12:59:51 UTC


README

http://www.v3toys.ru/index.php?nid=api

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist v3toys/yii2-api "*"

or add

"v3toys/yii2-api": "*"

How to use

//App config
[
    'components'    =>
    [
    //....
        'v3toys' =>
        [
            'class'             => '\v3toys\yii2\api\Api',
            'url'               => 'http://www.v3toys.ru/pear-www/Kiwi_Shop/api.php',
            'affiliate_key'     => 'fff',
            'timeout'           => 12,
        ],
    //....
    ]
]

Examples

$response = \Yii::$app->v3toys->send('getProductsDataByIds', [
    'products_ids' => 217070
]);

if ($response->isError)
{
    echo $response->error_code;
    echo $response->error_message;
}

if ($response->isOk)
{
    print_r($response->data);
}

print_r($response->statusCode);

skeeks!
SkeekS CMS (Yii2) — fast, simple, effective!
skeeks.com | cms.skeeks.com | marketplace.cms.skeeks.com