How can I validator some variable in my form

I have a new form that is Register form, and now I want to validate it

email, username, password, and Capcha

  • how can I check the capcha input ?

Hi,

in model file define rules:




     /**

      * Declares the validation rules.

      */

     public function rules()

     {

         return array(

             // verifyCode needs to be entered correctly

             array('Captcha', 'captcha', 'allowEmpty'=>!extension_loaded('gd')),

         );

     }

 

thanks you so much