brandcodenl/symfony-notification-bundle

A simple notification bundle

v0.1-beta 2019-06-14 09:23 UTC

This package is auto-updated.

Last update: 2025-06-15 14:03:02 UTC


README

This bundle offers some default resources for managing and displaying (user bound) facebook like notifications on your website.

Configure the bundle

  1. Create your own notification entity and extend the notification entity in this bundle.
<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use BrandcodeNL\SymfonyNotificationBundle\Entity\Notification as BaseNotification;

class Notification extends BaseNotification
{
}

To link the notifications to your own User entity, implement the BrandcodeNL\SymfonyNotificationBundle\Model\UserInterface in your Entity. After add the following config following lines to your config.yml/doctrine.yml file.

doctrine:
    orm: 
        resolve_target_entities:
            BrandcodeNL\SymfonyNotificationBundle\Model\UserInterface: Path\To\Your\Entity

There are some default routes included within this bundle for setting notifications to the status 'read', to use these you will have to include these routes in the routes.yml file.

brandcodenl_symfony_notification_bundle_routing:
    resource: "@BrandcodeNLNotificationBundle/Controller"
    prefix: /
    type: annotation

If you wish to use any of the default views provided by this bundle you can include them in your views:

 {% include '@BrandcodeNLNotification/NotificationContainer.html.twig' %}