For some reason my form builder forms are not being written to the database. Here’s the controller:
public function actionSignup()
{
$model=new PlgPledge;
$form = new CForm('application.views.pledge.signupForm',$model);
if($form->submitted('signup') && $form->validate()) {
$this->redirect(array('site/index'));
}
$this->render('signup', array('form'=>$form));
}
When I submit the form, no errors are generated, and I am sent to site/index. But nothing is written to the table, and I can’t find a way to debug this. Nothing funny is written in the logs.
I was following the instructions for using Form Builder in the Yii Guide. It covers non-table-related forms (log in) and nested forms, but doesn’t cover the most basic installation. Therefore, I was at a loss for a while in how to do $form->model->save() (I didn’t realize you could call model from form — but finally made the logical leap.)
Perhaps this could be included in the documentation in the future?