如何将我的 Bundle ComparisongameBundle 中的 javascript 文件包含在 twig 文件中? Assets 函数是什么意思?
最佳答案
你不相信symfony docs ?
You can also include assets located in your bundles' Resources/public folder. You will need to run the php app/console assets:install target [--symlink] command, which moves (or symlinks) files into the correct location. (target is by default "web").
<link href="{{ asset('bundles/acmedemo/css/contact.css') }}" type="text/css" rel="stylesheet" />
我不建议您链接到 bundle 中的单个资源 - 使用 Assetic为此,可能会缩小它们。
关于javascript - 如何将 Bundle 中的 javascript 文件包含到 twig 文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12334287/