PHPackages                             sheng/yii2doc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sheng/yii2doc

ActiveYii2-extension[API Development](/categories/api)

sheng/yii2doc
=============

yii2接口文档生成

v0.1(8y ago)31GPL-3.0PHP

Since Apr 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/yongshengli/yii2-doc)[ Packagist](https://packagist.org/packages/sheng/yii2doc)[ Docs](https://github.com/yongshengli/yii2-doc)[ RSS](/packages/sheng-yii2doc/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

yii2-doc根据action注释生成swagger所需的json文件
====================================

[](#yii2-doc根据action注释生成swagger所需的json文件)

效果
--

[](#效果)

[![出错了，图片找不到](demo.jpg)](demo.jpg)

INSTALLATION
------------

[](#installation)

```
composer require sheng/yii2doc

```

demo
----

[](#demo)

get参数可以使用query-param 也可以用request-param + http-method get request-param 会根据http-method 配置自动从请求的params 或者form中获取

```
/**
 * 这个里是接口名/接口说明
 * @http-method get
 * @request-param string $business_id 业务线id required
 * @request-param string $keyword 关键字(element.code, element.name, org.id)
 * @return array
 */
 public function actionIndex(){}

```

```
/**
 * 一条业务线元素列表
 * @http-method get
 * @query-param string $business_id 业务线id required
 * @query-param string $keyword 关键字(element.code, element.name, org.id)
 * @return array
 */
 public function actionIndex(){}

```

form字段参数

```
/**
 * 这个里是接口名/接口说明
 * @http-method post
 * @form-param string $business_id 业务线id required
 * @form-param string $keyword 关键字(element.code, element.name, org.id)
 * @return array
 */
 public function actionIndex(){}

```

```
/**
 * 这个里是接口名/接口说明
 * @http-method delete
 * @request-param string $business_id 业务线id required
 * @return array
 */
 public function actionIndex(){}

```

```
/**
 * 这个里是接口名/接口说明
 * @http-method put
 * @body-param array $body httpbody required
 * @return array
 */
 public function actionIndex(){}

```

接口分组现在是根据controller分组的

```
/**
* 第一行注释即为接口分组名
*
*/
class IndexController{}

```

swagger
-------

[](#swagger)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2955d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb001269e5faa19b75296e43178e122b9cce94ca4fbac750512be8487c0336fd?d=identicon)[yongshengli](/maintainers/yongshengli)

---

Tags

api-documentationphpswaggeryii2-docphpdocyii2api-doc

### Embed Badge

![Health badge](/badges/sheng-yii2doc/health.svg)

```
[![Health](https://phpackages.com/badges/sheng-yii2doc/health.svg)](https://phpackages.com/packages/sheng-yii2doc)
```

###  Alternatives

[jianyan74/yii2-easy-wechat

WeChat SDK for yii2, 基于 overtrue/easywechat

14339.4k1](/packages/jianyan74-yii2-easy-wechat)[harmbandstra/swagger-ui-bundle

Exposes swagger UI inside your Symfony project through a route (eg. /docs)

42867.3k](/packages/harmbandstra-swagger-ui-bundle)[luyadev/luya-headless

LUYA headless API client

1025.6k3](/packages/luyadev-luya-headless)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
