I have a Symfony2 form with a variety of fields, including one optional text field called recap
.
This recap
field saves perfectly when there\'s
Go to your Entity and go to the declaration of the variables.
/**
* @var string $name
*
* @ORM\Column(type="string", length=50)
*/
public $recap = '';
you can assign a default value for $recap.
Or otherway when you have the function setRecap you can check if empty or not set and set the value you expect.
public function setRecap($recap) {
$this->recap = !isset($recap) ? '': $recap;
}
Or you set the default Value in your form Type to '' but i think then its not what you expect.