PHPackages                             lengbin/yii-swagger - 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. lengbin/yii-swagger

ActiveLibrary[API Development](/categories/api)

lengbin/yii-swagger
===================

swagger ui 3.0 intergation with yii2

1.4(6y ago)446MITPHPPHP &gt;=5.3.0

Since Jun 17Pushed 6y agoCompare

[ Source](https://github.com/ice-leng/yii-swagger)[ Packagist](https://packagist.org/packages/lengbin/yii-swagger)[ RSS](/packages/lengbin-yii-swagger/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

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

Yii2 Swagger Ui 3.0 Extension
=============================

[](#yii2-swagger-ui-30-extension)

[swagger-php](https://github.com/zircote/swagger-php) intergation with yii2.

Integration [swagger-ui](https://github.com/swagger-api/swagger-ui) with [swagger-php](https://github.com/zircote/swagger-php).

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

[](#installation)

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

Either run

```
composer require lengbin/yii2-swagger "*"

```

or add

```
"lengbin/yii2-swagger": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Configure two action as below:

```
//The scan directories, you should use real path there.
DocController.php

public function actions()
{
    return [
        'doc' => [
            'class' => 'lengbin\swagger\SwaggerAction',
            'url' => \yii\helpers\Url::to(['/doc/api'], true),
            // support swagger ui 2 and  3
            'version' => \lengbin\swagger\SwaggerAction::SWAGGER_VERSION_DEFAULT,
            //if more url
            'urls' => [
                \yii\helpers\Url::to(['/doc/api'], true),
                ['name' => 'api', 'url' => '\yii\helpers\Url::to(['/doc/api2'], true)'],
            ],
            //'httpAuth' => ['account' => 'password'], // http auth
        ],
        'api' => [
            'class' => 'light\swagger\SwaggerApiAction',
            'scanDir' => [
                Yii::getAlias('@api/swagger'),
                Yii::getAlias('@api/modules/v1/controllers'),
            ],
        ],
    ];
}

```

extension
---------

[](#extension)

You can use Gii to quickly generate swaager openapi 2.0 extension [yii-gii-swagger](https://github.com/ice-leng/yii-gii-swagger).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Every ~13 days

Total

5

Last Release

2466d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9342ed631e7bf15897f2e15d0a853800b84cb315e601eb3a58f2cc8938b5d011?d=identicon)[ice.leng](/maintainers/ice.leng)

---

Top Contributors

[![ice-leng](https://avatars.githubusercontent.com/u/7506787?v=4)](https://github.com/ice-leng "ice-leng (6 commits)")

---

Tags

swaggeryii2extensionrestfuldocument

### Embed Badge

![Health badge](/badges/lengbin-yii-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/lengbin-yii-swagger/health.svg)](https://phpackages.com/packages/lengbin-yii-swagger)
```

###  Alternatives

[light/yii2-swagger

swagger intergation with yii2

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

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[ignatenkovnikita/yii2-swagger

Swagger UI v3 intergation with yii2

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