Can I insert a style tag and contents from a view with CakePHP?

Posted by Richard on Stack Overflow See other posts from Stack Overflow or by Richard
Published on 2010-05-20T14:15:24Z Indexed on 2010/05/20 14:20 UTC
Read the original article Hit count: 131

Filed under:

From what I can see, CakePHP makes it easy to link to a CSS file in a view with the following:

echo $html->css('my-css-filename',null,array(),FALSE);

But what if I don't want to exclusively use hardcoded files? How can I get it to create a style tag with some dynamically generated rules in e.g.

<style type="text/css" media="all">p {font-size:1.5em}</style>

I am trying to do this in a view file, I'd like the CSS to be placed in the head tag, and I'm using CakePHP 1.2.7

© Stack Overflow or respective owner

Related posts about cakephp