ZF-2398: Zend_View_Helper_HeadLink should be Doctype-aware

Issue Type: Bug Created: 2008-01-08T15:31:22.000+0000 Last Updated: 2008-03-21T16:25:41.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Adam Jensen (jazzslider) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: Attachments:


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:

<pre class="highlight">

Instead of the following:

<pre class="highlight">

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).


Posted by Kevin Golding (caomhin) on 2008-01-12T10:26:45.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2008-02-14T09:23:25.000+0000

Scheduling for 1.5.0, and upgrading priority slightly.

Posted by Matthew Weier O'Phinney (matthew) on 2008-02-19T16:31:36.000+0000

All head_() helpers and (hopefully) all form_() helpers are now doctype aware.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.