PHPackages                             iamok/yii2-swagger-ui - 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. iamok/yii2-swagger-ui

ActiveLibrary[API Development](/categories/api)

iamok/yii2-swagger-ui
=====================

扩展集成 swagger-ui 和 swagger-php，根据注释自动生成 OpenAPI 文档。

1.0.1(8y ago)23122MITPHP

Since Jan 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/wewelove/yii2-swagger-ui)[ Packagist](https://packagist.org/packages/iamok/yii2-swagger-ui)[ RSS](/packages/iamok-yii2-swagger-ui/feed)WikiDiscussions master Synced 2mo ago

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

yii2-swagger-ui
===============

[](#yii2-swagger-ui)

[![version](https://camo.githubusercontent.com/24bbc5690d0217265342930eddab03dcd156a0f6773e009c774ff508aae6d9a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69616d6f6b2f796969322d737761676765722d75692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iamok/yii2-swagger-ui)[![Download](https://camo.githubusercontent.com/af6760dcb8159e6b167a44b9914ca31525ec1244d59e7bea6d693bd8e2bc6c40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69616d6f6b2f796969322d737761676765722d75692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iamok/yii2-swagger-ui)[![Issues](https://camo.githubusercontent.com/ce2e8b25dcefe66868c54c791f12da7f8ff47edf7683b5a64d4dc7de11809a11/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f776577656c6f76652f796969322d737761676765722d75692e7376673f7374796c653d666c61742d737175617265)](https://github.com/wewelove/yii2-swagger-ui/issues)

扩展集成 [swagger-ui](https://swagger.io/swagger-ui/) 和 [swagger-php](https://github.com/zircote/swagger-php)，根据注释自动生成 OpenAPI 文档。

安装
--

[](#安装)

推荐使用 [composer](http://getcomposer.org/download/) 安装：

```
composer require --prefer-dist iamok/yii2-swagger-ui
```

应用
--

[](#应用)

修改项目配置文件 `./config/main.php`，添加 `docs` 项目:

```
'modules' => [
    'v1' => [
        'class' => 'app\modules\v1\Module',
    ],
    'v2' => [
        'class' => 'app\modules\v2\Module',
    ],
    'docs' => [
        'class' => 'iamok\swagger\Module',
        'name' => 'App',    // 项目名称
        'api' => [
            'v1' => ['swagger', 'controllers', 'models'],   // v1 版本，扫描目录
            'v2' => ['swagger', 'controllers', 'models']    // v2 版本，扫描目录
        ]
    ],
],
```

参考
--

[](#参考)

- [swagger](https://swagger.io/)
- [swagger-php](https://github.com/zircote/swagger-php)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~0 days

Total

2

Last Release

3050d ago

### Community

Maintainers

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

---

Top Contributors

[![wewelove](https://avatars.githubusercontent.com/u/1761876?v=4)](https://github.com/wewelove "wewelove (8 commits)")

---

Tags

swaggeryii2extension

### Embed Badge

![Health badge](/badges/iamok-yii2-swagger-ui/health.svg)

```
[![Health](https://phpackages.com/badges/iamok-yii2-swagger-ui/health.svg)](https://phpackages.com/packages/iamok-yii2-swagger-ui)
```

###  Alternatives

[light/yii2-swagger

swagger intergation with yii2

154801.6k4](/packages/light-yii2-swagger)[ignatenkovnikita/yii2-swagger

Swagger UI v3 intergation with yii2

128.0k](/packages/ignatenkovnikita-yii2-swagger)[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)
