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

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

autoxloo/yii2-apidoc
====================

API Documentation generator for the Yii framework 2.0 (fork)

3.1.0(1y ago)0109BSD-3-ClausePHPPHP &gt;=5.4

Since Mar 29Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (10)Versions (5)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)

> Note: This repository will be deleted after original update.

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 autoxloo/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:

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

afterwards run `composer update`. You may also run `composer update autoxloo/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

Maintenance34

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.9% 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 ~657 days

Total

4

Last Release

630d ago

Major Versions

2.1.3 → 3.0.12024-08-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e0af05c82328c2e95f5808024281b4f3779bed0a7abb450943973f1f6388472?d=identicon)[autoxloo](/maintainers/autoxloo)

---

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 (34 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)")[![VasylDmytruk](https://avatars.githubusercontent.com/u/32508794?v=4)](https://github.com/VasylDmytruk "VasylDmytruk (4 commits)")[![artem-levashov](https://avatars.githubusercontent.com/u/9528415?v=4)](https://github.com/artem-levashov "artem-levashov (3 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 (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)")[![tom--](https://avatars.githubusercontent.com/u/1178722?v=4)](https://github.com/tom-- "tom-- (2 commits)")[![mickgeek](https://avatars.githubusercontent.com/u/8091481?v=4)](https://github.com/mickgeek "mickgeek (1 commits)")[![hiqsol](https://avatars.githubusercontent.com/u/11820365?v=4)](https://github.com/hiqsol "hiqsol (1 commits)")[![nineinchnick](https://avatars.githubusercontent.com/u/795177?v=4)](https://github.com/nineinchnick "nineinchnick (1 commits)")[![cuileon](https://avatars.githubusercontent.com/u/313312?v=4)](https://github.com/cuileon "cuileon (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)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (1 commits)")

---

Tags

apiphpdocdocumentationyii2apidoc

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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