php - symfony js file URLs without assets/compile for development -
i'm working on symfony2 project , js , css files served compiled version under /assets/compiled/frontend_site_2.css /assets/compiled/frontend_jscript_2.js , actual version of these files under
src\projectname\bundle\webbundle\resources\assets\js\jscript.js src\projectname\bundle\webbundle\resources\assets\css\site.js
i want view render these urls instead of compiled versions, right 've dump these files running cmd php app/console assetic:dump --watch don't want run command after every single modication, possible?
frontend/javascript_block.htm.twig file {% javascripts output='assets/compiled/frontend.js' '@projectnamewebbundle/resources/public/js/jscript.js' %} <script type="text/javascript" src="{{ asset_url }}"></script> {% endjavascripts %}
thanks
in dev mode can put list of js files want include in 'javascripts' block, this:
{% javascripts '@yourbundle/resources/public/path/to/your_js_file' '@yourbundle/resources/public/path/to/your_another_js_file' %} <script src="{{ asset_url }}"></script> {% endjavascripts %}
so, looks sample except strange place: "output=". haven't met before.
to work javascript files without run dump command can use sample above. works on several projects. , think must work you.
in production mode run
assetic:dump
command , that's it.
Comments
Post a Comment