FOSCommentBundle功能包:安装功能包

  • 原文出处:1-setting_up_the_bundle.md

  • 原文作者:FriendsOfSymfony

  • 授权许可:创作共用协议

  • 翻译人员:FireHare

  • 校对人员:

  • 适用版本:FOSCommentBundle 2.0.5

  • 文章状态:草译阶段

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步:创建您的评论类和线索类。


你可能感兴趣的:(Bundle,symfony2,功能包,安装功能包)