开发者

Load files in view.yml Symfony

I'm working on a Symfony project and I am seeing this in a view.yml file. What is the meaning of it:

javascript: 
  - js/jquery.min.js 

I can see that this sentence loads the library but, what the difference开发者_开发问答 between that and this:

javascript: [js/jquery.min.js]

Also, I have other problem: When I want load another component, it does not load the jquery library; why is that?


It's a way to do lists in YAML, for example in an app I have:

profileViewSuccess:
  javascripts:
    - /jquery-ui/js/jquery-ui-1.8.7.custom.min.js
    - /js/jquery.periodicalupdater.js
    - /js/jgrowl/jquery.jgrowl.js
    - /js/jquery-uniform/jquery.uniform.js
    - /js/lightbox.js
    - /js/profile.view.js
    - http://maps.google.com/maps/api/js?sensor=false

This looks nicer than:

profileViewSuccess:
  javascripts: [/jquery-ui/js/jquery-ui-1.8.7.custom.min.js, /js/jquery.periodicalupdater.js, /js/jgrowl/jquery.jgrowl.js] 

etc. etc. with all the other files.


Did you cleared cache running "symfony cc"? When you change a configuration file you must run such command to apply the changes.

Hope this helps. On the other hand your english is pretty hard to understand XD I'm spanish as well but I think spanish is not allowed here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜