PHPackages                             biaoqianwo/yii2-apidoc - 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. biaoqianwo/yii2-apidoc

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

biaoqianwo/yii2-apidoc
======================

API Documentation generator for the Yii framework 2.0

2.1.3(8y ago)00BSD-3-ClausePHPPHP &gt;=5.4

Since Apr 13Pushed 8y agoCompare

[ Source](https://github.com/biaoqianwo/yii2-apidoc)[ Packagist](https://packagist.org/packages/biaoqianwo/yii2-apidoc)[ RSS](/packages/biaoqianwo-yii2-apidoc/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (14)Used By (0)

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

API documentation generator for Yii 2
=====================================

[](#api-documentation-generator-for-yii-2)

This extension provides an API documentation generator for the [Yii framework 2.0](http://www.yiiframework.com).

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/71cfa0165579d6c49e122261599cb4f6d36b4d72e7e43af09680bbc642584902/68747470733a2f2f706f7365722e707567782e6f72672f6269616f7169616e776f2f796969322d617069646f632f762f737461626c652e706e67)](https://packagist.org/packages/biaoqianwo/yii2-apidoc)[![Total Downloads](https://camo.githubusercontent.com/28ef1f2143da680afd26c2a92aff47184abee1a7c5ce4d405dca6fee1d308067/68747470733a2f2f706f7365722e707567782e6f72672f6269616f7169616e776f2f796969322d617069646f632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/biaoqianwo/yii2-apidoc)[![Build Status](https://camo.githubusercontent.com/016a573b1fef86981b74118b78db42287c4524d39f2068570b7bb082ee3f7ac8/68747470733a2f2f7472617669732d63692e6f72672f6269616f7169616e776f2f796969322d617069646f632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/biaoqianwo/yii2-apidoc)

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

[](#installation)

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

Either run

```
composer require --prefer-dist biaoqianwo/yii2-apidoc

```

The above command may not work on an existing project due to version conflicts that need to be resolved, so it is preferred to add the package manually to the require section of your composer.json:

```
"biaoqianwo/yii2-apidoc": "~2.1.3"
```

afterwards run `composer update`. You may also run `composer update biaoqianwo/yii2-apidoc cebe/markdown` if you want to avoid updating unrelated packages.

Usage
-----

[](#usage)

This extension offers two commands:

- `api` to generate class API documentation.
- `guide` to render nice HTML pages from markdown files such as the yii guide.

Simple usage for stand alone class documentation:

```
vendor/bin/apidoc api source/directory ./output

```

Simple usage for stand alone guide documentation:

```
vendor/bin/apidoc guide source/docs ./output

```

You can combine them to generate class API and guide documentation in one place:

```
# generate API docs
vendor/bin/apidoc api source/directory ./output
# generate the guide (order is important to allow the guide to link to the apidoc)
vendor/bin/apidoc guide source/docs ./output

```

By default the `bootstrap` template will be used. You can choose a different template with the `--template=name` parameter. Currently there is only the `bootstrap` template available.

You may also add the `yii\apidoc\commands\ApiController` and `GuideController` to your console application command map and run them inside of your applications console app.

### Generating docs from multiple sources

[](#generating-docs-from-multiple-sources)

The apidoc generator can use multiple directories, so you can generate docs for your application and include the yii framework docs to enable links between your classes and framework classes. This also allows `@inheritdoc` to work for your classes that extend from the framework. Use the following command to generate combined api docs:

```
./vendor/bin/apidoc api ./vendor/biaoqianwo/yii2,. docs/json --exclude="docs,vendor"

```

This will read the source files from `./vendor/biaoqianwo/yii2` directory and `.` which is the current directory (you may replace this with the location of your code if it is not in the current working directory).

### Advanced usage

[](#advanced-usage)

The following script can be used to generate API documentation and guide in different directories and also multiple guides in different languages (like it is done on yiiframework.com):

```
#!/bin/sh

# set these paths to match your environment
YII_PATH=~/dev/biaoqianwo/yii2
APIDOC_PATH=~/dev/biaoqianwo/yii2/extensions/apidoc
OUTPUT=yii2docs

cd $APIDOC_PATH
./apidoc api $YII_PATH/framework/,$YII_PATH/extensions $OUTPUT/api --guide=../guide-en --guidePrefix= --interactive=0
./apidoc guide $YII_PATH/docs/guide    $OUTPUT/guide-en --apiDocs=../api --guidePrefix= --interactive=0
./apidoc guide $YII_PATH/docs/guide-ru $OUTPUT/guide-ru --apiDocs=../api --guidePrefix= --interactive=0
# repeat the last line for more languages
```

### Creating a PDF of the guide

[](#creating-a-pdf-of-the-guide)

You need `pdflatex` and GNU `make` for this.

```
vendor/bin/apidoc guide source/docs ./output --template=pdf
cd ./output
make pdf

```

If all runs without errors the PDF will be `guide.pdf` in the `output` dir.

Special Markdown Syntax
-----------------------

[](#special-markdown-syntax)

We have a special Syntax for linking to classes in the API documentation. See the [code style guide](https://github.com/yiisoft/yii2/blob/master/docs/internals/core-code-style.md#markdown) for details.

Creating your own templates
---------------------------

[](#creating-your-own-templates)

TBD

Using the model layer
---------------------

[](#using-the-model-layer)

TBD

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 64.5% 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 ~124 days

Recently: every ~135 days

Total

13

Last Release

2920d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65043553783e26857146cd82158daf7f77db1d2ad7117cfe342716b3ff4740db?d=identicon)[biaoqianwo](/maintainers/biaoqianwo)

---

Top Contributors

[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (191 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (30 commits)")[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (28 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (11 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (6 commits)")[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (6 commits)")[![biaoqianwo](https://avatars.githubusercontent.com/u/3367795?v=4)](https://github.com/biaoqianwo "biaoqianwo (3 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (3 commits)")[![tom--](https://avatars.githubusercontent.com/u/1178722?v=4)](https://github.com/tom-- "tom-- (2 commits)")[![rob006](https://avatars.githubusercontent.com/u/5972388?v=4)](https://github.com/rob006 "rob006 (2 commits)")[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (2 commits)")[![hiqsol](https://avatars.githubusercontent.com/u/11820365?v=4)](https://github.com/hiqsol "hiqsol (1 commits)")[![mickgeek](https://avatars.githubusercontent.com/u/8091481?v=4)](https://github.com/mickgeek "mickgeek (1 commits)")[![cuileon](https://avatars.githubusercontent.com/u/313312?v=4)](https://github.com/cuileon "cuileon (1 commits)")[![nineinchnick](https://avatars.githubusercontent.com/u/795177?v=4)](https://github.com/nineinchnick "nineinchnick (1 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (1 commits)")[![ricpelo](https://avatars.githubusercontent.com/u/616169?v=4)](https://github.com/ricpelo "ricpelo (1 commits)")[![SonicGD](https://avatars.githubusercontent.com/u/1222013?v=4)](https://github.com/SonicGD "SonicGD (1 commits)")[![CedricYii](https://avatars.githubusercontent.com/u/14201156?v=4)](https://github.com/CedricYii "CedricYii (1 commits)")[![bazilio91](https://avatars.githubusercontent.com/u/380542?v=4)](https://github.com/bazilio91 "bazilio91 (1 commits)")

---

Tags

apiphpdocdocumentationyii2apidoc

### Embed Badge

![Health badge](/badges/biaoqianwo-yii2-apidoc/health.svg)

```
[![Health](https://phpackages.com/badges/biaoqianwo-yii2-apidoc/health.svg)](https://phpackages.com/packages/biaoqianwo-yii2-apidoc)
```

###  Alternatives

[yiisoft/yii2-apidoc

API Documentation generator for the Yii framework 2.0

257701.8k31](/packages/yiisoft-yii2-apidoc)[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M878](/packages/phpdocumentor-phpdocumentor)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[apigen/apigen

PHP source code API generator.

2.2k627.9k225](/packages/apigen-apigen)[pronamic/wp-documentor

Documentation Generator for WordPress.

6529.8k5](/packages/pronamic-wp-documentor)[unionofrad/li3_docs

An API and wiki-like documentation generator.

1682.6k](/packages/unionofrad-li3-docs)

PHPackages © 2026

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