How to fix FOSComment when i add it to the template?

356 Views Asked by At

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".

And this is my Config.yml flile

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 } 
1

There are 1 best solutions below

0
On

Add FOSCommentBundle into your Assetic configuration in config.html

assetic:
    bundles:        ["FOSCommentBundle"]