ju4nr3v0l/notificaciones-vanadio

通知 - 钒

安装: 10

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 58

类型:symfony-bundle

2.0.4 2018-04-02 18:44 UTC

This package is not auto-updated.

Last update: 2024-10-02 18:51:12 UTC


README

一个简单而强大的 Symfony 通知包

Latest Stable Version Latest Unstable Version Total Downloads License

SensioLabsInsight

mgilet/notificationBundle

高效创建和管理通知。

Symfony 支持

  • 2.7.x
  • 2.8.x
  • 3.x

特性

  • 简单设置
  • 易于使用
  • 强大的通知管理
  • 简单的 Twig 渲染方法
  • 完全可定制
  • 多个可通知实体
  • 无冗余依赖(要求少)

注意:目前仅支持 Doctrine ORM。

安装与使用

安装

此包可在 packagist 上找到。

第一步

$ composer require mgilet/notification-bundle

查看文档获取下一步信息

基本用法

class MyController extends Controller
{

    ...

    public function sendNotification(Request $request)
    {
       $manager = $this->get('mgilet.notification');
      $notif = $manager->createNotification('Hello world !');
      $notif->setMessage('This a notification.');
      $notif->setLink('https://symfony.com.cn/');
      // or the one-line method :
      // $manager->createNotification('Notification subject','Some random text','http://google.fr');

      // you can add a notification to a list of entities
      // the third parameter `$flush` allows you to directly flush the entities
      $manager->addNotification(array($this->getUser()), $notif, true);
      
      ...
    }

更多详情请查看这里

翻译

目前此包只翻译成 de, en, es, fr, it。

通过提交您的翻译来帮助我改进。

社区

您可以通过贡献(每个 pull request 都将被考虑)或提交问题来帮助改进此包。

如果您喜欢,请享受并分享。

许可证

MIT