我使用 SonataCommentBundle 版本 ~2.2@dev,在集成这个包后我尝试使用 http://xx.out.tn/app_dev.php/comments/threads
它给了我:
The class 'Application\Sonata\CommentBundle\Entity\Thread' was not found in the chain configured namespaces Application\Sonata\PageBundle\Entity, Sonata\PageBundle\Entity, Application\Sonata\MediaBundle\Entity, Sonata\MediaBundle\Entity, FOS\UserBundle\Entity, Application\Sonata\UserBundle\Entity, Sonata\UserBundle\Entity, Sonata\NotificationBundle\Entity, Application\Sonata\NotificationBundle\Entity, FOS\CommentBundle\Entity, Sonata\CommentBundle\Entity, Sonata\ClassificationBundle\Entity, Application\Sonata\ClassificationBundle\Entity, Spy\TimelineBundle\Entity, Application\Sonata\TimelineBundle\Entity, Sonata\Bundle\DemoBundle\Entity, Sonata\TimelineBundle\Entity
这是我的 config.yml :
fos_comment:
db_driver: orm
class:
model:
comment: Application\Sonata\CommentBundle\Entity\Comment
thread: Application\Sonata\CommentBundle\Entity\Thread
form:
comment:
type: sonata_comment_comment
assetic:
bundles: [ "FOSCommentBundle" ]
路由.yml:
fos_comment:
type: rest
resource: "@FOSCommentBundle/Resources/config/routing.yml"
prefix: /comments
defaults: { _format: html }