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