0

How can I make feature to load for example css files depending on controller

For example I have action registrationAction() which is method of AccountController.

I need to look at the bundle/sitebundle/css/Account/registration.css and if file exists import stylesheet !

Alexei T
  • 710
  • 1
  • 7
  • 17
  • How about changing the css in your view? – cheesemacfly Jul 29 '13 at 14:33
  • I want to separate this code and do it automaticaly. If file exists - load it. I'm new to symfony so I don't know better way to do it - via twig extension or via service (dependency injection) – Alexei T Jul 29 '13 at 14:36
  • You will probably find something here then: http://stackoverflow.com/a/14232207/1443490 – cheesemacfly Jul 29 '13 at 14:45
  • So, you think, Best way to achieve this goal is to extends twig and write code in a function. – Alexei T Jul 29 '13 at 16:08
  • That's a way to do it. I am not sure I fully understand your goal so it's hard to say if it is the best solution :) Do you have a case scenario? – cheesemacfly Jul 29 '13 at 16:13

0 Answers0