Im trying to add a captcha using yii to my contact form, but there is some problem with validation.
My model
class ContactForm extends CFormModel {
your model is empty , because you didn't pass any value to $model->attriburtes
$model->attriburtes
Do this :
if($_POST['ContactForm']) { $model->attributes() = $_POST['ContactForm']; if($model->validate()) { //some code } } $this->render('advertise', array('model' => $model));