m-adamski / symfony-notification-bundle
The Symfony Bundle was created to support simple notifications
Installs: 961
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.2
- symfony/framework-bundle: ^7.1
- symfony/twig-bundle: ^7.1
Requires (Dev)
- kint-php/kint: ^5.0
- symfony/test-pack: ^1.1
README
The Symfony Bundle was created to support simple notifications. Compared to previous versions, this one is based on simple methods of creating and adding notifications.
Version 5.0 doesn't have compatibility with previous versions.
Installation
Composer can install this bundle:
$ composer require m-adamski/symfony-notification-bundle
How to use it?
Compared to the previous version, to add a notification, we call the add
function:
use Adamski\Symfony\NotificationBundle\Helper\NotificationHelper; use Adamski\Symfony\NotificationBundle\Model\Notification; use Adamski\Symfony\NotificationBundle\Model\Type; $this->notificationHelper ->add(new Notification(Type::SUCCESS, "Sample notification")) ->add(new Notification(Type::SUCCESS, "Second sample notification"));
The custom Twig function is responsible for displaying notifications (place it somewhere in the template):
{{ notification() }}
License
MIT