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, where url is the reference URL linked ...

Get Yii2 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.