Is there a way to use the checkbox form type with a field that has been set to string?
This field can hold many values, it can be used to input data as a textfield or as a checkbox.
I have a event listener on the formtype to check if it should be a checkbox or text field.
/Entity.php
/**
* @var string
*
* @ORM\Column(name="value", type="string", length=200, nullable=true)
*/
private $value;
formtype.php
$form->add('value', 'checkbox', array(
))
Error
Unable to transform value for property path "value": Expected a Boolean.