Art*_*hur 5 php forms doctrine annotations zend-framework2
我花了几个小时用这个头撞墙。无论如何,我的表单字段的标签都没有出现。
最后发现,如果没有光标所在的额外空间(见图),所有注释都会被忽略。我将 ZF 2.1.1 与 Doctrine Common 2.2.3 一起使用。
难道我做错了什么?或者这是 ZF 或 Doctrine 解析器中的错误?

作品:
class LoginForm
{
/** @Annotation\Type("text")
* @Annotation\Options({"label":"Store ID:"})
* @Annotation\Required(true)
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Validator({"name":"StringLength","options":{"min":2,"max":64}})
*/
public $sStoreId;
}
Run Code Online (Sandbox Code Playgroud)
失败,除非 /** 后面有一个空格:
class LoginForm
{
/**
* @Annotation\Type("text")
* @Annotation\Options({"label":"Store ID:"})
* @Annotation\Required(true)
* @Annotation\Filter({"name":"StringTrim"})
* @Annotation\Validator({"name":"StringLength","options":{"min":2,"max":64}})
*/
public $sStoreId;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1046 次 |
| 最近记录: |