zend 指定的 doctype 格式错误 errord
所以我试图通过在我的layout.phtml中输入以下内容来将RDFA doctype添加到zend中...
$doctypeHelper = new Zend_View_Helper_Doctype();
$doctypeHelper->doctype('XHTML1_RDFA');
这样我就能够使用headMeta->appendProperty()函数...但是然后它返回了这个错误:
Fatal error: Uncaught exception 'Zend_View_Exception' with message 'The specified doctype is malformed'
我该如何解决这个问题?
so I was trying to add the RDFA doctype into zend by typing the following into my layout.phtml...
$doctypeHelper = new Zend_View_Helper_Doctype();
$doctypeHelper->doctype('XHTML1_RDFA');
so that I will be able to use the headMeta->appendProperty() function....but then it returned this error:
Fatal error: Uncaught exception 'Zend_View_Exception' with message 'The specified doctype is malformed'
how do I resolve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我敢打赌你的 zend 框架版本是 1.11.2 之前的,因为只有当传递给 doctype 函数的文本无法识别时才会出现该错误。
它基本上只是遍历已识别的文档类型数组,如果您输入的文本与数组中的任何内容都不匹配,它会检查您是否有格式正确的文档类型字符串(以手动设置文档类型)。如果您的字符串未验证,则会抛出该异常。
如果您好奇,可以在代码中的 doctype 函数中看到它: Doctype 助手源
I would bet your zend framework version is is before 1.11.2, because that error only comes up if the text passed to the doctype function isn't recognized.
It basically just goes through the array of recognized doctypes and if the text you input doesn't match any in the array, it checks to see if you have a properly formatted doctype string (to manually set the doctype). If your string doesn't validate it throws that exception.
You can see it in the doctype function in the code if you are curious: Doctype Helper Source