Generating an API documentation
Documentation is definitively one of the most important aspects of an app, since it provides information about its flows and structures. Unfortunately, it is often omitted due to lack of time.
Yii give us a powerful tool to automatically generate a pretty documentation. Basically, it uses all the documentation comments present in the app, those starting with /**
instead of the classic /*
.
Therefore, we have the advantage that comments in the code are used to produce a complete documentation.
Inside these comments, there are few keywords that are usable according to the context—file, class, or function/method.
In case of a file, the most common keywords to put on top are:
@link url
, whereurl
is the reference URL linked to the file@copyright text
, where text is the content of copyright@license url
, whereurl
is the reference to license content
In case of a class, the most common keywords to put on top are:
@author name
, where name is the name of the author...