Symfony and composer component folder
config.yml
1 2 3 | jquery: inputs: - %kernel.root_dir%/../vendor/components/jquery/jquery.min.js |
composer.json
1 2 3 4 5 | "require": { "components/jqueryui" :"dev-master", "components/jquery": "dev-master" }, //... |
Jquery 位于 vendor\\\\\\\\composer 但 symfony 不重新协调此路径:
[message] The source file
"F:\\UniServerZ\\www\\app/../vendor/jquery/jquery/jquery.min.js" does not
exist.
如何链接到 components/ 文件夹?....
好吧,我想那是因为 jQuery 应该在公共文件夹
composer.json:
1 2 3 4 | "config": { "bin-dir":"bin", "component-dir":"web/components" }, |
你可以像 (
1 2 3 | {% javascripts 'components/jquery/jquery.min.js' %} <script src="{{ asset_url }}"> {% endjavascripts %} |
希望对你有帮助。