I understand the general concept of assetic, which makes sense for site-wide script resources, but what about the javascript that is specific to one page or controller? How do you structure those, where would one keep them, and then how would they be added to the templates?
1 Answer
Typically what I do is create a 'controllers' folder inside my Resources\public\js folder and then create a file with the same name as the controller it's going to be used in. Then all you need to do in your twig template is include the file using the assetic <% javascripts %><% endjavascripts %> tag.