PHPackages                             cornernote/gii-modeldoc-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cornernote/gii-modeldoc-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cornernote/gii-modeldoc-generator
=================================

Gii ModelDoc Generator for Yii framework

1.2.7(9y ago)13110.6k↓67.4%4[3 issues](https://github.com/cornernote/gii-modeldoc-generator/issues)BSD-3-ClausePHP

Since Dec 19Pushed 9y ago4 watchersCompare

[ Source](https://github.com/cornernote/gii-modeldoc-generator)[ Packagist](https://packagist.org/packages/cornernote/gii-modeldoc-generator)[ RSS](/packages/cornernote-gii-modeldoc-generator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

Gii ModelDoc Generator for Yii
==============================

[](#gii-modeldoc-generator-for-yii)

ModelDoc Generator will extend Gii allowing an update to existing models with [phpDoc](http://phpdoc.org/docs/latest/index.html) compatible documentation.

Features
--------

[](#features)

- **Table Fields**
    - Adds properties for each field.
    - Properties are annotated with field comments from the database.
- **Relations**
    - Adds a property with a return type for each relation.
- **CActiveRecord Inheritance**
    - Adds methods inherited from CActiveRecord including: find(), findByPk(), findByAttributes(), fndBySql(), findAll(), findAllByPk(), findAllByAttributes(), findAllBySql(), with(), together(), cache(), resetScope(), populateRecord() and populateRecords().
- **Behaviors**
    - Adds a property with a return type for each behavior.
    - Adds methods assigned for behaviors, unless it is defined by the model itself.
    - Optionally uses @mixin for behaviors.
- **Scopes**
    - Adds a method for each scope.
- **Full Syntax**
    - All PHPDoc tags contain full syntax including: method params and return types.
    - All returned models have namespace support.

Screenshots
-----------

[](#screenshots)

Listing all the models that are going to have phpDocs inserted: [![Files](https://camo.githubusercontent.com/2be7ceff48cac56947ec70f923793d11d7c3dd7f56172f0c61a62787f061208d/68747470733a2f2f7261772e6769746875622e636f6d2f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f6d61737465722f73637265656e73686f742f66696c65732e706e67)](https://camo.githubusercontent.com/2be7ceff48cac56947ec70f923793d11d7c3dd7f56172f0c61a62787f061208d/68747470733a2f2f7261772e6769746875622e636f6d2f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f6d61737465722f73637265656e73686f742f66696c65732e706e67)

Preview of the model before it gets updated: [![Preview](https://camo.githubusercontent.com/4f1783b9bc102b6b9f2d13f7870e57826498ea591de16a646763994766157bb7/68747470733a2f2f7261772e6769746875622e636f6d2f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f6d61737465722f73637265656e73686f742f707265766965772e706e67)](https://camo.githubusercontent.com/4f1783b9bc102b6b9f2d13f7870e57826498ea591de16a646763994766157bb7/68747470733a2f2f7261772e6769746875622e636f6d2f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f6d61737465722f73637265656e73686f742f707265766965772e706e67)

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

[](#installation)

Please download using ONE of the following methods:

### Composer Installation

[](#composer-installation)

All requirements are automatically downloaded into the correct location when using composer. There is no need to download additional files or set paths to third party files.

Get composer:

```
curl http://getcomposer.org/installer | php

```

Install latest release OR development version:

```
php composer.phar require cornernote/gii-modeldoc-generator:*				// latest release
php composer.phar require cornernote/gii-modeldoc-generator:dev-master	// development version

```

Add the `vendor` folder to the `aliases` in your yii configuration:

### Manual Installation

[](#manual-installation)

Download the [latest release](https://github.com/cornernote/gii-modeldoc-generator/releases/latest) or [development version](https://github.com/cornernote/gii-modeldoc-generator/archive/master.zip) and move the `gii-modeldoc-generator` folder into your `protected/modules` folder.

Configuration
-------------

[](#configuration)

Add the path to `gii-modeldoc-generator` to the `generatorPaths` in your gii configuration:

```
return array(
	'modules' => array(
		'gii' => array(
			'class'=>'system.gii.GiiModule',
			'generatorPaths' => array(
				// use this if you installed with composer
				'/path/to/vendor/cornernote/gii-modeldoc-generator/gii',

				// OR, use this if you downloaded into your extensions folder
				//'ext.gii-modeldoc-generator.gii',
			),
		),
	),
);
```

Usage
-----

[](#usage)

Ensure you have `--- BEGIN ModelDoc ---` and `--- END ModelDoc ---` in each of your models, for example:

```
/**
 * Your class description that will not be altered by ModelDoc
 *
 * --- BEGIN ModelDoc ---
 *
 *  this section will be replaced by ModelDoc
 *
 * --- END ModelDoc ---
 */
class MyModel extends CActiveRecord { ... }
```

Visit `index.php?r=gii`, then choose ModelDoc from the menu.

Notes
-----

[](#notes)

This extension will not create any new model files. You should first create them or generate them with a model generator.

Resources
---------

[](#resources)

- **[Documentation](http://cornernote.github.io/gii-modeldoc-generator)**
- **[GitHub Project](https://github.com/cornernote/gii-modeldoc-generator)**
- **[Yii Extension](http://www.yiiframework.com/extension/gii-modeldoc-generator)**

Support
-------

[](#support)

- Does this README need improvement? Go ahead and [suggest a change](https://github.com/cornernote/gii-modeldoc-generator/edit/master/README.md).
- Found a bug, or need help using this project? Check the [open issues](https://github.com/cornernote/gii-modeldoc-generator/issues) or [create an issue](https://github.com/cornernote/gii-modeldoc-generator/issues/new).

License
-------

[](#license)

[BSD-3-Clause](https://raw.github.com/cornernote/gii-modeldoc-generator/master/LICENSE), Copyright © 2013-2014 [Mr PHP](mailto:info@mrphp.com.au)

[![Mr PHP](https://camo.githubusercontent.com/5c2a4e06b8343bc0132af3775a46e3cbe9b40f69708f11bf40869fc560fdde17/68747470733a2f2f7261772e6769746875622e636f6d2f636f726e65726e6f74652f6d727068702d6173736574732f6d61737465722f696d672f636f64652d62616e6e65722e706e67)](http://mrphp.com.au) [![Project Stats](https://camo.githubusercontent.com/c2f477071331f80611304e390864be1ce6c46abc419b275e87d305451437bec6/68747470733a2f2f7777772e6f686c6f682e6e65742f702f6769692d6d6f64656c646f632d67656e657261746f722f776964676574732f70726f6a6563745f7468696e5f62616467652e676966)](https://www.ohloh.net/p/gii-modeldoc-generator)

[![Latest Stable Version](https://camo.githubusercontent.com/2ea490155d0a70444233160a538c43ac68a889ad61fa0f801889b3b678f4aca5/68747470733a2f2f706f7365722e707567782e6f72672f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f762f737461626c652e706e67)](https://github.com/cornernote/gii-modeldoc-generator/releases/latest) [![Total Downloads](https://camo.githubusercontent.com/bb4a138096bb1576f84af9ea9284c45899432cc88f9a0d08189e7dfa75138b6c/68747470733a2f2f706f7365722e707567782e6f72672f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/cornernote/gii-modeldoc-generator) [![Monthly Downloads](https://camo.githubusercontent.com/db9056a9ac9764180a0197d760fbd842e714c09e2ce7a540e8b51a8b5d23c1d4/68747470733a2f2f706f7365722e707567782e6f72672f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f642f6d6f6e74686c792e706e67)](https://packagist.org/packages/cornernote/gii-modeldoc-generator) [![Latest Unstable Version](https://camo.githubusercontent.com/dc7e0a8e146dc72a279c245600e46afbf7cbd6c4ce86703be14c0c0f7fc545d8/68747470733a2f2f706f7365722e707567782e6f72672f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f762f756e737461626c652e706e67)](https://github.com/cornernote/gii-modeldoc-generator) [![Build Status](https://camo.githubusercontent.com/2c75eb33d31ae69dca6381f2037e149255e90a6ef49397df6c0af6077ed8638a/68747470733a2f2f7472617669732d63692e6f72672f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/cornernote/gii-modeldoc-generator) [![License](https://camo.githubusercontent.com/a26b67112c0b121d0a7ec7fbe8a992764b72a0db9a20eafb6d2653c714699cb8/68747470733a2f2f706f7365722e707567782e6f72672f636f726e65726e6f74652f6769692d6d6f64656c646f632d67656e657261746f722f6c6963656e73652e706e67)](https://raw.github.com/cornernote/gii-modeldoc-generator/master/LICENSE)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 92.4% 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 ~138 days

Recently: every ~277 days

Total

10

Last Release

3332d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/07c84a589344489e8195ec1c6afcfa3abcc23a73092ceaa4ca60da96355c4d16?d=identicon)[cornernote](/maintainers/cornernote)

---

Top Contributors

[![cornernote](https://avatars.githubusercontent.com/u/51875?v=4)](https://github.com/cornernote "cornernote (85 commits)")[![gureedo](https://avatars.githubusercontent.com/u/1492714?v=4)](https://github.com/gureedo "gureedo (2 commits)")[![miramir](https://avatars.githubusercontent.com/u/686364?v=4)](https://github.com/miramir "miramir (2 commits)")[![BBoom](https://avatars.githubusercontent.com/u/1442485?v=4)](https://github.com/BBoom "BBoom (1 commits)")[![marcovtwout](https://avatars.githubusercontent.com/u/438046?v=4)](https://github.com/marcovtwout "marcovtwout (1 commits)")[![zainengineer](https://avatars.githubusercontent.com/u/4746235?v=4)](https://github.com/zainengineer "zainengineer (1 commits)")

---

Tags

yiigiimrphpmodelDoc

### Embed Badge

![Health badge](/badges/cornernote-gii-modeldoc-generator/health.svg)

```
[![Health](https://phpackages.com/badges/cornernote-gii-modeldoc-generator/health.svg)](https://phpackages.com/packages/cornernote-gii-modeldoc-generator)
```

###  Alternatives

[romka-chev/yii2-swiper

Yii2 extension for Swiper slider

1840.6k](/packages/romka-chev-yii2-swiper)[raoul2000/yii-simple-workflow

A simple workflow engine for Yii 1

278.2k](/packages/raoul2000-yii-simple-workflow)[romdim/yii2-bootstrap-material

Composer package for implementing FezVrasta's bootstrap material design in Yii2.

2010.9k3](/packages/romdim-yii2-bootstrap-material)

PHPackages © 2026

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