If you create a boolean field in the database and symfony renders it as a checkbox ( sfWidgetFormInputCheckbox ) in the form... AND DOCTRINE DOES NOT SAVE THE VALUE TO THE DATABASE, you have to a put the boolean validator on it and doctrine will save the value. That's the magic.
$this->setValidators(array(
...,
'enabled' => new sfValidatorBoolean(),
...,
));
No comments:
Post a Comment