I want to add a boolean value to my Entity.
It looks like this:
namespace MyModule\MyClass\Entity;
use Doctrine\ORM\Mapping as ORM;
use Zend\Form\Annotation as Form;
/**
* @ORM\Entity
* @ORM\Table(name="mymodule_myclass")
* @Form\Name("myclass")
* @Form\Attributes({ "class": "form-horizontal" })
*/
class MyClass
...
/**
* @ORM\Column(type="boolean")
* @Form\Attributes({"type":"checkbox"})
* @Form\Options({"label":"Revised"})
*
*/
protected $revised = false;
Of course I want to display this variable as a checkbox. So I added the @Form\Attributes.
Unfortunately I get a
“NetworkError: 500 Internal Server Error”
Any ideas why that is and what I can do to fix it?
BTW: Altering the type attribute manually per Firebug turns the input field into a checkbox…
The solution is to use Zend-Checkbox and not change the type of the input.