Step 1: Setting up the bundle

A) Download and install FOSCommentBundle(下载安装FOSCommentBundle)

To install FOSCommentBundle run the following command

要安装FOSCommentBundle,可以运行以下命令:

$ php composer.phar require friendsofsymfony/comment-bundle

B) Enable the bundle(启用功能包)

Enable the required bundles in the kernel:

在内核中启用所需功能包:

<?php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new FOS\RestBundle\FOSRestBundle(),
        new FOS\CommentBundle\FOSCommentBundle(),
        new JMS\SerializerBundle\JMSSerializerBundle($this),
    );
}

C) Enable Http Method Override(启用Http方法覆写)

Enable HTTP Method override as described here

这里有启用Http方法覆写的说明


As of symfony 2.3, you just have to modify your config.yml :

截至Symfony 2.3,您只需要修改您的 config.yml 文件:

# app/config/config.yml
framework:
    http_method_override: true

Continue to the next step!(继续下一步)

When you're done. Continue by creating the appropriate Comment and Thread classes:

当您完成之后,接下来您就可以继续创建适当的评论类和线索类:

Step 2: Create your Comment and Thread classes.

第2步:创建您的评论类和线索类。