v3project / yii2-api
V3toys yii2 api
2.0.1
2019-03-14 11:20 UTC
Requires
- yiisoft/yii2: ^2.0.16
- yiisoft/yii2-httpclient: ^2.0.0
This package is auto-updated.
Last update: 2024-09-17 01:01:32 UTC
README
http://www.v3toys.ru/index.php?nid=api
安装
安装此扩展的首选方法是通过 composer。
运行以下命令之一
php composer.phar require --prefer-dist v3toys/yii2-api "*"
或添加
"v3toys/yii2-api": "*"
如何使用
//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);
SkeekS CMS (Yii2) — 快速、简单、有效!
skeeks.com | cms.skeeks.com | marketplace.cms.skeeks.com