Adding an XHTML Strict Doctype and CSS File the Zend Way
January 7th, 2009Using zend_layout, a CSS file and doctype will be set through some helpful tools provided in the Zend Framework.
Using zend_layout, a CSS file and doctype will be set through some helpful tools provided in the Zend Framework.
Firstly, great “ZendCasts” – thanks for taking the time to do these.
I don’t see why you’d set the doctype in the bootstrap – seems no added benefit to just having it in the layout?
Anyway, just a thought. Will probably become obvious when I start playing with Zend properly – perhaps when it comes to ajax & co and I end up using various doctypes in the project, it might be useful to set it outside of a view.
Hey Craig,
It seems a little silly to be using a whole architecture for these sorts of things initially, however I could imagine instances where you’d want to handle different doctypes for different platforms (i.e. if you have some sort of API with different layouts for different users… maybe I’m streatching this…).
Anyways, I thought it was an interesting feature with a pattern that parallelled how CSS and JS can be inserted into Zend’s templating system.
Thanks a lot to http://www.zendcasts.com.
Every episod is really very educative.
Thanks again!!
My understanding of setting the doctype in the bootstrap, or even the purpose of setting it in code at all (as opposed to hard coding in the layout) is so other code -that runs before the layout- can ‘know’ what type of markup you are using and can generate the right type.
Though the discussion on whether or not you should do that in the first place is a different matter