Does anyone know how to add stylesheets in a template with Symfony 1.4 ?
I have tried everything I can think of, from modifying frontend/config/view.yml to modifying the
Edit:
Ok I think I got it now. You should add include_stylesheets()
into the head
section of your layout file:
This is the title
Then in your template file, you use use_stylesheet()
to add a particular stylesheet for this template:
From the API documentation:
include_stylesheets()
Printstags for all stylesheets configured in view.yml or added to the response object.
use_stylesheet()
Adds a stylesheet to the response object.
Same for Javascript.
According to the API documentation it should still work in 1.4, sfWebResponse
still has this method:
addStylesheet ($file, $position, $options) $file The stylesheet file $position Position $options Stylesheet options Adds a stylesheet to the current web response.
At least the method exists.
What exactly is the problem? Do you get an error if you want to call that method or is the stylesheet just not added?