I would like to write an internal style sheet to a view in Zend Framework as such
<head>
<style type="text/css" media="all">
body{ background: #FFFFFF; }
</style>
</head>
I understand that I can write an external style sheet using $this->view->headLink()->appendStylesheet('style.css');
However I cannot find a way to write an internal style sheet. Any ideas?
What you are looking for is called the
HeadStyleview helper. Its manual documentation can be found here.The
HeadStylehelper’s API is consistent will all theHead*view helpers, and works as such (the following assumes you are in a viewscript):Note that you do not include the
<style>tags in any of this input. That is generated by the helper itself.Then, in your layout, simply
echothe helper where you’d like its output: