The Zend_View_Helper_HeadLink component uses shorthand tag closing notation on all link elements, regardless of the DOCTYPE provided to the Zend_View_Helper_Doctype component. I.e., it always produces elements like the following:
The current behavior is fine for documents written as XHTML, but not necessarily for HTML without the X; running such a document through the W3 validator (as, say, HTML 4.01 Strict) produces warnings and errors.
This is a fairly trivial problem (since most browsers have no problem handling this kind of shorthand even in older flavors of HTML), but I think it would also be fairly trivial to fix (in fact, there's a good, simple precedent in lines 374-380 of the HeadScript helper), and doing so would make the framework's output more compliant with W3 standards (if only a little).
Description
The Zend_View_Helper_HeadLink component uses shorthand tag closing notation on all link elements, regardless of the DOCTYPE provided to the Zend_View_Helper_Doctype component. I.e., it always produces elements like the following:
The current behavior is fine for documents written as XHTML, but not necessarily for HTML without the X; running such a document through the W3 validator (as, say, HTML 4.01 Strict) produces warnings and errors.
This is a fairly trivial problem (since most browsers have no problem handling this kind of shorthand even in older flavors of HTML), but I think it would also be fairly trivial to fix (in fact, there's a good, simple precedent in lines 374-380 of the HeadScript helper), and doing so would make the framework's output more compliant with W3 standards (if only a little).
This seems to be the source of a few inconsistencies
Neither Zend_View_Helper_HeadMeta or Zend_View_Helper_HeadStyle make any allowances for different doctypes either, however both default to using non-XHTML mark-up.
Other Zend_View_Helper_* seem to default to XHTML, as in this case, although I've only checked a few.
As we have a doctype check with isXhtml() it seems sensible to use it across the board and to have a consistent default. At the moment tag soup is inevitable due to the existing defaults and the fact that only one Helper seems to allow changes.
Kevin Golding - 12/Jan/08 10:26 AM This seems to be the source of a few inconsistencies
Neither Zend_View_Helper_HeadMeta or Zend_View_Helper_HeadStyle make any allowances for different doctypes either, however both default to using non-XHTML mark-up.
Other Zend_View_Helper_* seem to default to XHTML, as in this case, although I've only checked a few.
As we have a doctype check with isXhtml() it seems sensible to use it across the board and to have a consistent default. At the moment tag soup is inevitable due to the existing defaults and the fact that only one Helper seems to allow changes.
Neither Zend_View_Helper_HeadMeta or Zend_View_Helper_HeadStyle make any allowances for different doctypes either, however both default to using non-XHTML mark-up.
Other Zend_View_Helper_* seem to default to XHTML, as in this case, although I've only checked a few.
As we have a doctype check with isXhtml() it seems sensible to use it across the board and to have a consistent default. At the moment tag soup is inevitable due to the existing defaults and the fact that only one Helper seems to allow changes.