this is my model: */
class Contact extends BaseContact
{
public $verifyCode
.....
public function rules()
{
return array(
.......
array('verifyCode', 'captcha', 'captchaAction'=>'site/captcha', 'message'=>'Captcha invalid!')
);
}
...
this is my controller:
if(!$model->validate()){
.....
}else{
if($model->save(false)){
}
and this is my view:
$this->widget('CCaptcha',
array(
'captchaAction' =>'site/captcha',
'buttonOptions' => array('class'=>'test','style' => 'display:block'),
'buttonLabel' => 'Schimbă codul'
)
);
The fact is that it is always model->validate() is false . Why ?