General problem with Yii documentation

I found it Yii documentation is extremaly unfriendly to newbie users.

Guess why! - Here you are example:

Have a look at ‘CCaptcha’ class docs:

http:||www.yiiframework.com/doc/api/1.1/CCaptcha

and now tell me please how should I know the right usage pattern is like this one for instance:


$this->widget("CCaptcha", array('buttonLabel'=>'Change one for me', 'buttonOptions'=>array('style'=>'margin-bottom:20px;')));

This is the fundamental problem with starting work with Yii - you never know how to use the class api as there is no information provided concerning its proper implementation:

  • where put class files

  • how to initialize and object or interface

  • how dependency injection is organized in Yii and how to access objects in global scope

This is the outcome of my fruitless attempts to get CViewAction->basePath from controler. Hell knows how to access CViewAction object - what is right syntax for that - documentation is pointless here.

Any comments on the subject, please?

The API is really designed to be used by people who already have some experience with the framework. It’s definitely difficult for a newcomer to use, but there is a pretty good guide which everyone should read before using the framework, and there are many tutorials and wikis to further guide you thereafter.

Yeap - but there is a huge gap between this guide and real life development.

Simply - try to follow it’s ‘access control rules’ and you will never find critically important information about default rules on SiteController. Neither you will learn on generic objects accessing syntax etc.

For whatever reason documentation is hermetic.

Agreed, the guide is a little short on detail at times. I remember it taking quite a bit of effort to figure out access control and RBAC. I suspect that the wiki articles are the way to go, for instance:

http://www.yiiframework.com/wiki/328/simple-rbac/

I personally would prefer more details in the guide though.