An exception has been thrown during the compilation of a template ("You must add FOSCommentBundle to the assetic.bundle config to use the
{% javascripts %}
tag in FOSCommentBundle:Thread:async.html.twig.") in "FOSCommentBundle:Thread:async.html.twig".
这是我的 Config.yml 文件
fos_comment:
db_driver: orm
class:
model:
comment: Esprit\CommentBundle\MyBundle\Entity\Comment
thread: Esprit\CommentBundle\Entity\Thread
assetic:
bundles: [ FOSCommentBundle ]
fos_comment_api:
type: rest
resource: "@FOSCommentBundle/Resources/config/routing.yml"
prefix: /api
defaults: { _format: html }
最佳答案
将 FOSCommentBundle 添加到 config.html 中的 Assets 配置
assetic:
bundles: ["FOSCommentBundle"]
关于javascript - 当我将 FOSComment 添加到模板时如何修复它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33959483/