php - Hot to use assets javascript -


i create own bundle in symfony2:

steve/testbundle

and in steve/testbundle/resources/public/js

i add own file main.js , next use symfony2 command - assets:install.

in: steve/testbundle/resources/views/home.html.twig make:

<script src="{{ asset('/bundles/stevetest/js/main.js') }}" type="text/javascript"></script> 

this working ok, if make changes must again use assets:install.

is possible making changes without still use assets:install?

"-1" because have read first symfony2 documentation/quickstart/cookbook ! :)

for question can use "symlink" "asset:install" cmd create symbolic link (like unix cmd "ln -s")

so if check doc, have 2 possibilities :

  • with symfony2 cmd -> "php app/console asset:install your_path/ --symlink"
  • or in composer.json file :

code :

"extra": {     "symfony-app-dir": "app",     "symfony-web-dir": "web",     "symfony-assets-install": "symlink" } 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -