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

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

bingying2/yii2-apidoc
=====================

API Documentation generator for the Yii framework 2.0

2.2.1(4y ago)040BSD-3-ClausePHPPHP &gt;=5.4

Since Apr 13Pushed 4y agoCompare

[ Source](https://github.com/bingying2/yii2-apidoc)[ Packagist](https://packagist.org/packages/bingying2/yii2-apidoc)[ GitHub Sponsors](https://github.com/yiisoft)[ Fund](https://opencollective.com/yiisoft)[ RSS](/packages/bingying2-yii2-apidoc/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (10)Versions (24)Used By (0)

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

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/ec20075a6dbd496dfd6e4e91d82f4eb1c30a8785590d0730deacf8bd37a1e4fc/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d617069646f632f762f737461626c652e706e67)](https://packagist.org/packages/yiisoft/yii2-apidoc)[![Total Downloads](https://camo.githubusercontent.com/18ae723036ed1976992fb05375a9152678fa2d3313c398d3f6fe8cb1eb0ff6bc/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d617069646f632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/yiisoft/yii2-apidoc)[![Build Status](https://camo.githubusercontent.com/76b1e7729855246f626a973db49907db1c9cb2c875296db591df7ccba6587112/68747470733a2f2f7472617669732d63692e6f72672f796969736f66742f796969322d617069646f632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yiisoft/yii2-apidoc)

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

[](#installation)

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

Either run

```
composer require --prefer-dist yiisoft/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:

```
"yiisoft/yii2-apidoc": "~2.1.0"
```

afterwards run `composer update`. You may also run `composer update yiisoft/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/yiisoft/yii2,. docs/json --exclude="docs,vendor"

```

This will read the source files from `./vendor/yiisoft/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/yiisoft/yii2
APIDOC_PATH=~/dev/yiisoft/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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 57.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 ~128 days

Recently: every ~17 days

Total

23

Last Release

1595d ago

Major Versions

2.1.6 → 3.0.x-dev2021-08-30

PHP version history (2 changes)2.1.0PHP &gt;=5.4

3.0.x-devPHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b3bf7727f8b9439bca0a05849da4e4925b9053a0fda382a4137998cb3180a68?d=identicon)[冰鹰2](/maintainers/%E5%86%B0%E9%B9%B02)

---

Top Contributors

[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (195 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (58 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)")[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (6 commits)")[![bingying2](https://avatars.githubusercontent.com/u/10571540?v=4)](https://github.com/bingying2 "bingying2 (6 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (6 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (3 commits)")[![machour](https://avatars.githubusercontent.com/u/304450?v=4)](https://github.com/machour "machour (3 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (3 commits)")[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (2 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)")[![SonicGD](https://avatars.githubusercontent.com/u/1222013?v=4)](https://github.com/SonicGD "SonicGD (1 commits)")[![kublahanov](https://avatars.githubusercontent.com/u/635939?v=4)](https://github.com/kublahanov "kublahanov (1 commits)")[![bazilio91](https://avatars.githubusercontent.com/u/380542?v=4)](https://github.com/bazilio91 "bazilio91 (1 commits)")[![bu4ak](https://avatars.githubusercontent.com/u/17143820?v=4)](https://github.com/bu4ak "bu4ak (1 commits)")[![CedricYii](https://avatars.githubusercontent.com/u/14201156?v=4)](https://github.com/CedricYii "CedricYii (1 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (1 commits)")[![cuileon](https://avatars.githubusercontent.com/u/313312?v=4)](https://github.com/cuileon "cuileon (1 commits)")

---

Tags

apiphpdocdocumentationyii2apidoc

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/bingying2-yii2-apidoc/health.svg)](https://phpackages.com/packages/bingying2-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)
