xutongle 2016-01-24 03:10:22 5810次浏览 1条评论 5 1 0

适用于 Yii2 的 ApiStore SDK扩展

该扩展为 Yii framework 添加 ApiStore 客户端。

For license information check the LICENSE-file.

Documentation is at docs/guide/README.md.

Latest Stable Version
Total Downloads

安装

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist xutongle/yii2-apistore

or add

"xutongle/yii2-apistore": ">=1.0.1"

to the require section of your composer.json.

注意:本扩展的二次开发非常简单,我只做了百度的手机归属地查询和身份证查询,这两个就一个方法,只要继承Baidu类并实现get方法即可无限扩展百度的API,
当然也有简单的办法,即直接使用Baidu类作为api类,获取到实例后如下即可:

$baidu = Yii::$app->apiClientCollection->getApi('baidu');
$response = $baidu->api('apistore/mobilenumber/mobilenumber', 'GET', ['phone' => $mobile]);
var_dump($response);

欢迎fork本代码,并将你的客户端pull给我,我更新到新版里面,另外只要继承基类做类似Baidu类的实现,即可实现其他非百度ApiStore平台Api接入

https://github.com/xutongle/yii2-apistore

觉得很赞
您需要登录后才可以评论。登录 | 立即注册