Where the captcha location is?

for me, yii documentation… is very rambling… :(

i confused where, the capctcha location is.

I just installed yii framework. and run the console is working fine…

in the address bar was written “index.php?r=site/captcha”, so I find where is the captcha location and make me confues… :(

please help me…

captcha must be an action of a controller (SiteController in your case):

public function actions()


    return array(

        'captcha' => array(

            'class'     => 'CCaptchaAction',

            'backColor' => 0xF5F5F5,




‘backColor’ is not the only property you can set. You can find other available properties there: http://www.yiiframework.com/doc/api/CCaptchaAction

oo… thank you very much master, your little answer is opening my mind to read again the documentation.

but its really help me… :-), so I now know that actions() method is one of the requirements and considered as controller that can be called from address bar.

yeahh… I wanna to using this framework within know about how this framework is built

overall, very thanks to help me :slight_smile:

Actually there is no magic. You just attach an action to a controller (actions can be classes), and, when this action is called, it renders an image and saves generated number in user’s session.

Oh ya sir…

are actions() method is some of the rules that will executed automatically by yii when it run?

how about relations() method and rules() method in model. are this same as with actions() that belong to special method by yii

because this name of method is like generally not made into special name like adding underscore at first (eg: __get() or __set ) that seems are special method that determined by framework


Sure it’s a special method (like relations() and rules()). When Yii can not find a controller’s action, it calls actions() method for help. If this method can’t help, then missingAction() method is called.