Yii Framework Forum: Where the captcha location is? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Where the captcha location is? Rate Topic: -----

#1 User is offline   Dan Din Dun 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 09-February 10

Posted 09 February 2010 - 04:47 AM

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....
Thanks and Kind Regards
------
DanDinDun
0

#2 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 09 February 2010 - 06:01 AM

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.yiiframew.../CCaptchaAction
0

#3 User is offline   Dan Din Dun 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 09-February 10

Posted 09 February 2010 - 06:22 AM

View Postandy_s, on 09 February 2010 - 06:01 AM, said:

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.yiiframew.../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 :-)
Thanks and Kind Regards
------
DanDinDun
0

#4 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 09 February 2010 - 07:37 AM

View PostDan Din Dun, on 09 February 2010 - 06:22 AM, said:

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 :-)


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.
0

#5 User is offline   Dan Din Dun 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 09-February 10

Posted 09 February 2010 - 03:36 PM

View Postandy_s, on 09 February 2010 - 07:37 AM, said:

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

thanks
Thanks and Kind Regards
------
DanDinDun
0

#6 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 09 February 2010 - 03:52 PM

View PostDan Din Dun, on 09 February 2010 - 03:36 PM, said:

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

thanks


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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users