Using zend_layout, a CSS file and doctype will be set through some helpful tools provided in the Zend Framework.
Adding an XHTML Strict Doctype and CSS File the Zend Way
Description
Using zend_layout, a CSS file and doctype will be set through some helpful tools provided in the Zend Framework.
Tags
css, doctype, xhtml, zend_layout

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
by using
C:\Windows\System32\drivers\etc\hosts
and
D:\xampp\apache\conf\extra\httpd-vhosts.conf
i have set the directory D:\xampp\htdocs\zendcast
into
http://zendcast.local/
and follows the same directory structure in the tutorial
but when i tried to load the CSS with the line
$this->headlink()->appendStylesheet(‘css/main.css’);
it didn’t work
when i have given
$this->headlink()->appendStylesheet(‘/public/css/main.css’);
it works
please clarify me why it so