public function action() { $model=new ; // uncomment the following code to enable ajax-based validation /* if(isset($_POST['ajax']) && $_POST['ajax']==='class2id($modelClass); ?>-form') { echo CActiveForm::validate($model); Yii::app()->end(); } */ if(isset($_POST[''])) { $model->attributes=$_POST['']; if($model->validate()) { // form inputs are valid, do something here return; } } $this->render('',array('model'=>$model)); }