Changes
Title
changed
How to generate Yii -like Documentation
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
doc
Content
changed
Introduction
------------
Something a good application cant miss is documentation, and what would be better than some nice formatted HTML documentation that can be auto-generated from your code, we know several tools that already do this like [phpDocumentor](http://www.phpdoc.org/ "phpDocumentor"), but today we are introducing [Yii Docs Generator](
http
s://
github.com/phpnode/Yii-Dwww.yiiframework.com/extension/yiidocs
-Ggenerator "Yii Docs Generator") which is a modification of the code that Yii itself uses to generate its documentation, thank [phpnode](http://www.yiiframework.com/forum/index.php?/user/22573-phpnode/ "phpnode") for this wonderful work.
Specification
------------------
To generate nice HTML however we must follow some specifications that this wiki will try to describe.
The following are 2 classes that we will be using as an example:[...]
### Documenting Views
If you want to annotatedocument your views, add a doc block right at the top of the view file with the file description. You can also specify the parameters that your view file receives by using the @uses tag, e.g.
[
```php
]
<?php
/**[...]
* @uses User $model The user model
*/
~~~```
If you don't want to document your views you can turn this behaviour off by adding the parameter noviews to the end of the shell command, e.g.
./yiic docs /path/to/your/docs/folder noviews
Thats it for now, the Yii Docs Generator is still a work in progress but as you can see its already a powerful too, that will get you some nice documentation and as you can see its pretty easy to use.
The Yii Docs Generator also comes with a check command, that will help you check if there is some important missing documentation, but wont check things like @package of class documentation so its always good to check your files manually after using this command.
Resources
---------
- [Yii Docs Generator on Git]( https://github.com/phpnode/Yii-Docs-Generator "Yii Docs Generator")
- [Yii Docs Generator on Yii](http://www.yiiframework.com/extension/yiidocsgenerator "Yii Docs Generator")