From examples I have seen the only way to submit a form back to the controller/action that rendered it is if you used a model in the view, for example:
public function actionLogin()
{
$model=$this->loadModel($id);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if(isset($_POST['User']))
{
$model->attributes=$_POST['User'];
if($model->save())
$this->redirect(array('view','id'=>$model->id));
}
$this->render('login',array(
'model'=>$model,
));
}
but what if I have a custom controller/action and custom form that doesn’t have a model? How would I check if it was submitted? In the above example you can simply use
Yii’s scaffolding adds the model because the way the form is generated, submitting a form has nothing to with having a model or not (rather then for example validating/inserting data)
I think if you just want to create a custom form, you should use the CFormModel. Also if you just want to render a view, then you just need to pass the view name, e.g.
...
$this->render('viewName');
...
You can also check the LoginForm.php that is created with the default Yii App.