zhuzixian520/yii2-api-doc
最新稳定版本:1.0.0
Composer 安装命令:
composer require zhuzixian520/yii2-api-doc
包简介
Generate online api document by code annotation for yii2 easily
关键字:
README 文档
README
Yii2 Annotations Generate API Document Extension
yii2-api-doc
Generate online api document by code annotation for yii2 easily
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist zhuzixian520/yii2-api-doc "*"
or add
"zhuzixian520/yii2-api-doc": "*"
to the require section of your composer.json file and run
composer install
Usage
Once the extension is installed, simply use it in your code by :
return [ 'modules' => [ 'api_doc' => [ 'class' => 'zhuzixian520\api_doc\Module', 'hostApiDev' => 'http://api-dev.demo.com',//开发环境接口主机地址 'hostApiProd' => 'http://api.demo.com',//生产环境接口主机地址 'hostApiTest' => 'http://api-test.demo.com',//测试环境接口主机地址 'author' => 'Trevor', 'email' => 'service@wangxiankeji.com', 'logo_src' => '/img/logo_64_64.png',//web目录下 'icp_num' => '粤ICP备15025495号', 'copyright_website' => 'http://www.sijiche.com', 'company_start_year' => '2015', ], 'v1' => [ 'class' => 'api\modules\v1\V1Module', ], ], ];
Controller code comments in the API
class PassportController extends yii\rest\Controller { /** * 微信PC网页登录 * @method POST * @token 0 * @param string code 同意授权后的code 是 * @res string token 访问令牌 * @return array */ public function actionLoginByWechatPc(): array {} }
Output
Access the API document address
just like gii or debug,and you can also change the V parameter to switch API versions
http://yourhost/api_doc?v=1
Contact Us
Email:zhuzixian520@126.com
统计信息
- 总下载量: 985
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-26

