Form Builder: Debug DB errors ?

Hi all,

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.

Can anyone help?

Where is the save() statement?

/Tommy

Just a note - you posted in the Yii 1.0 section… are you using that version?

CForm is available since 1.1, so I guess not :) Topic moved.

Yes — this is what was missing.

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?

Thanks