javascript - 当我将 FOSComment 添加到模板时如何修复它?

标签 javascript symfony

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/

相关文章:

php - 强制 silex 框架生成 https 链接

php - Symfony ChoiceType 动态填充选项并初始化空选项数组

javascript - jQuery切换允许父元素的默认href并且父元素应该显示子元素(切换)

javascript - 如何在除 app.js 之外的不同文件中构建套接字 io 服务器

javascript - Mongoose Promise 不将数据传递到下一个链

javascript - ajax请求后脚本不再工作

javascript - 当我使用公共(public)文件夹 Symfony 4 时,我的 css 和 js 文件没有加载