Careful where you set your doctype

Along with the resolution of this view helper bug concerning view helpers not being doctype aware, comes a small gotcha if you are relying on setting your doctype in layouts like so:

echo $this->doctype('XHTML1_STRICT');

The problem is that view helpers will not be aware of this setting and will revert to the default setting HTML4_LOOSE. To avoid this be sure to set the doctype earlier in the bootstrap process, something like so:

$viewRenderer->view->doctype('XHTML1_STRICT');

Posted by Nick on 24th February 2008 under Tips and Tricks |

Trackback URI | Comments RSS

Leave a Reply