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 template itself – bothing works.
I have seen from my searches, that other people have had the same problem. There seems to be a clash of sorts between using include_stylesheets and use_stylesheets – however this is not documented anywhere AFAIK.
Edit:
Ok I think I got it now. You should add
include_stylesheets()into theheadsection of your layout file:Then in your template file, you use
use_stylesheet()to add a particular stylesheet for this template:From the API documentation:
Same for Javascript.
According to the API documentation it should still work in 1.4,
sfWebResponsestill has this method: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?