I find http://www.yiiframework.com/doc/api an enormous resource every time I’m working on an application. But one thing it lacks, and the one which I feel is very important, is practical examples of functions being used.
php.net has done a great job by leaving this to users (it is debatable of course). Each time someone is confused with a function or wants to look up advanced functions in PHP’s official website, there is not only documentation available but also good number of examples given, which, a user can directly relate to his code. It serves the purpose of learning the API greatly.
I just feel if we can do something similar on this website, many people will benefit from it. Because, theory is important, no doubt, but a demo of practical application can make the toughest concepts easy to understand.
That is true, but it’s really different from what I am suggesting.
If, for example, I’m looking for examples of using findByAttributes() at http://www.yiiframework.com/doc/api/1.1/CActiveRecord#findByAttributes-detail, the documentation contains only the theory of 8-10 lines. It is not practical to scroll all the way down to see if there is any example available, every time I want to look up a particular function. This is because the page is not specific to that particular function. So, along with existing theory for that function, if we have a small button at the end of it, which, upon clicking, shows all the examples of using findByAttributes(), wouldn’t it be great?