Zend Framework 2 - Annotation Forms don't work

后端 未结 2 532
天命终不由人
天命终不由人 2021-01-06 11:41

Thanks to @Hikaru-Shindo I looked into AnnotationForms which seem to be the best available as a work-around for ModelForms. But the example shown h

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 12:15

    Had the same problem. The solution is a mindbreaker. Took me long time to find out. The problem lies in the first line of your annotation code.

    /**
    

    This line is normally used for commenting your annotation code, but allmost everybody leaves it empty. Normally no issues, but this is somehow causing problems in the form annotations. You should either add some comment, add a space, or move your first line of code up. So:

    /** Some comment to make this annotation work
    /** (<-- a space)
    

    or start like this:

    /** @ORM\Column(type="string")
    

    Don't ask me why this is happening, found the solution somewhere online. As I understood the bug has been reported.

提交回复
热议问题