PHP code example of v3project / yii2-api

1. Go to this page and download the library: Download v3project/yii2-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

v3project / yii2-api example snippets


//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,
        ],
    //....
    ]
]



$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);


php composer.phar