FOSCommentBundle功能包:与FOSUserBundle集成

简介:

Step 6: Integration with FOSUserBundle

By default, comments are made anonymously.FOSUserBundle authentication can be used to sign the comments.

缺省情况下,评论是匿名的。FOSUserBundle 认证可以用来标识评论。

A) Setup FOSUserBundle(安装FOSUserBundle)

First you have to setup FOSUserBundle. Check the instructions.

首先您需要安装 FOSUserBundle。请参阅说明

B) Extend the Comment class(扩展评论类)

In order to add an author to a comment, the Comment class should implement the SignedCommentInterface and add a field to your mapping.

为了为评论添加作者,Comment类需要实现SignedCommentInterface接口,并添加一个字段到您的映射。


For example in the ORM:

例如,在ORM中:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// src/MyProject/MyBundle/Entity/Comment.php
namespace  MyProject\MyBundle\Entity;
use  Doctrine\ORM\Mapping  as 


本文转自 firehare 51CTO博客,原文链接:http://blog.51cto.com/firehare/1258154,如需转载请自行联系原作者
相关文章
|
9月前
CTK框架 - 插件依赖关系 - 给插件加上界面
在第一篇文章中吗,我们提到了MANIFEST.MF中有个字段是依赖关系,这次我们来测试一下这个依赖关系:
119 0
|
机器人 中间件 开发者
ros_control功能包
ros中与gazebo仿真关系很大的功能包 ros_control功能包 也是ros_control软件框架
ros_control功能包