PHPackages                             zhuzixian520/yii2-api-doc - 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. zhuzixian520/yii2-api-doc

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

zhuzixian520/yii2-api-doc
=========================

Generate online api document by code annotation for yii2 easily

1.0.0(5y ago)16969MITPHPPHP &gt;=7.4.0

Since Apr 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/zhuzixian520/yii2-api-doc)[ Packagist](https://packagist.org/packages/zhuzixian520/yii2-api-doc)[ RSS](/packages/zhuzixian520-yii2-api-doc/feed)WikiDiscussions master Synced 1mo ago

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

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Yii2 Annotations Generate API Document Extension
================================================

[](#yii2-annotations-generate-api-document-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/63f78d2d987d1493370cf5125b9e6a20a8c0e8412b4707fdd0686943b594167b/68747470733a2f2f706f7365722e707567782e6f72672f7a68757a697869616e3532302f796969322d6170692d646f632f76)](//packagist.org/packages/zhuzixian520/yii2-api-doc)[![Total Downloads](https://camo.githubusercontent.com/71ffc871933ba1235a3c7f58bda2dc5d7789b2b42bf3c920ea094d01357da363/68747470733a2f2f706f7365722e707567782e6f72672f7a68757a697869616e3532302f796969322d6170692d646f632f646f776e6c6f616473)](//packagist.org/packages/zhuzixian520/yii2-api-doc)[![Latest Unstable Version](https://camo.githubusercontent.com/f7da0e1e3922abfb1a8af0ed7b64169f1f55e11b70ae33b7ed54325c2f24b5bd/68747470733a2f2f706f7365722e707567782e6f72672f7a68757a697869616e3532302f796969322d6170692d646f632f762f756e737461626c65)](//packagist.org/packages/zhuzixian520/yii2-api-doc)[![License](https://camo.githubusercontent.com/517b031883f9056f74d94e6cbc374aefd032ea8a46b6178c7f397c06df79235e/68747470733a2f2f706f7365722e707567782e6f72672f7a68757a697869616e3532302f796969322d6170692d646f632f6c6963656e7365)](//packagist.org/packages/zhuzixian520/yii2-api-doc)[![Suggesters](https://camo.githubusercontent.com/7d006fcf1d74e212a3c55f14bf3b5e69b45a998ea4d293e637dc1719aaac14b1/68747470733a2f2f706f7365722e707567782e6f72672f7a68757a697869616e3532302f796969322d6170692d646f632f73756767657374657273)](//packagist.org/packages/zhuzixian520/yii2-api-doc)[![Dependents](https://camo.githubusercontent.com/8a393ea82ad378200b5846276743f65be9e70838e010fbc54aae7e024fabcba0/68747470733a2f2f706f7365722e707567782e6f72672f7a68757a697869616e3532302f796969322d6170692d646f632f646570656e64656e7473)](//packagist.org/packages/zhuzixian520/yii2-api-doc)

yii2-api-doc
============

[](#yii2-api-doc)

Generate online api document by code annotation for yii2 easily

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

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
-----

[](#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

[![img.png](img.png)](img.png)

[![img_1.png](img_1.png)](img_1.png)

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：

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

1842d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/508df745ed44bd6036128dfd031e1a549315dc73580a33c154b68a429bee181d?d=identicon)[zhuzixian520](/maintainers/zhuzixian520)

---

Top Contributors

[![zhuzixian520](https://avatars.githubusercontent.com/u/16476541?v=4)](https://github.com/zhuzixian520 "zhuzixian520 (17 commits)")

---

Tags

apiyii2-extensionyii2extensionapi-doc

### Embed Badge

![Health badge](/badges/zhuzixian520-yii2-api-doc/health.svg)

```
[![Health](https://phpackages.com/badges/zhuzixian520-yii2-api-doc/health.svg)](https://phpackages.com/packages/zhuzixian520-yii2-api-doc)
```

###  Alternatives

[dotzero/yii2-amocrm

Расширение для Yii Framework 2 реализующее клиент для работы с API amoCRM

1639.7k](/packages/dotzero-yii2-amocrm)[conquer/services

Yii2 soap wsdl web services

1632.5k](/packages/conquer-services)[apexwire/yii2-restclient

Tools to use API as ActiveRecord for Yii2

143.5k](/packages/apexwire-yii2-restclient)

PHPackages © 2026

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