如何使用Sonata Notification Bundle?

时间:2016-04-17 00:05:54

标签: symfony notifications sonata

我想在我的symfony(2.8)项目中添加Notifications系统,我认为Sonata Notification Bundle可以提供帮助,但事实证明我不知道如何使用它,我安装得很好,但我不知道如何在我的项目中使用它。 我需要一些关于这个包的帮助,一些教程左右。 要么 还有另一种使用通知系统的方法,请告诉我, 先感谢您 我想使用通知包的控制器

  

命名空间LocationBundle \ Controller;

使用Symfony \ Component \ HttpFoundation \ Request; 使用Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller;

使用LocationBundle \ Entity \ Agence; 使用Symfony \ Component \ HttpFoundation \ JsonResponse;

/ **  * Agence控制器。  *  * / class AgenceController扩展了Controller {     / **      *列出所有Agence实体。      *      * /     公共函数indexAction()     {
        $ em = $ this-> getDoctrine() - > getManager();

sudo usermod -aG docker $USER

1 个答案:

答案 0 :(得分:1)

我很确定Sonata Notification Bundle不是您正在搜索的内容。标题中的“通知”一词在您的情况下有点误导。 Bundle用于使用像RabbitMQ这样的队列系统推迟动作/事件。

您正在搜索的内容:看一下Symfony自己的“Flash消息”:http://symfony.com/doc/current/book/controller.html#flash-messages

它非常容易实现,您不需要额外的捆绑包。