magik/notification-bundle
Composer 安装命令:
composer require magik/notification-bundle
包简介
A simple Symfony 4 bundle for user notifications
README 文档
README
An easy yet powerful notification bundle for Symfony
Create and manage notifications in an efficient way.
Symfony support :
- 2.7.x (bundle version 2.x)
- 2.8.x (bundle version 2.x)
- 3.x
- 4.x
NOW SUPPORTS SYMFONY FLEX !
Version 3.0 out now.
Features
- Easy setup
- Easy to use
- Powerful notification management
- Simple Twig render methods
- Fully customizable
- Multiple notifiables entities
- No bloated dependencies (little requirements)
Notice: Only Doctrine ORM is supported for now.
Installation & usage
This bundle is available on packagist.
Add notification-bundle to your project :
$ composer require mgilet/notification-bundle
See documentation for next steps
Basic usage
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/'); // or the one-line method : // $manager->createNotification('Notification subject', 'Some random text', 'https://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); ... }
Translations
For now this bundle is only translated to de, en, es, fa, fr, it, nl, pt_BR.
Help me improve this by submitting your translations.
Community
You can help make this bundle better by contributing (every pull request will be considered) or submitting an issue.
Enjoy and share if you like it.
Licence
MIT
统计信息
- 总下载量: 128
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-15