catpcha validation


I have member`s model class generated by yiic. I added a captcha attribute to this class.

The problem is when form is validate, because field captcha is not checked (always is that captcha code is not valid)

What should I do to the attribute will check when I call $model->validate()?

Now I do like this:







not sure if I understand you. Do you mean the validation always fails? Did you check if $model->captcha contains correct value?

Now it works, but if I not write


this does not work. Do I have to manually copy data from form to model or can be automatically happen?

You need to list it in safeAttributes() if you want it to be copied automatically.