notification-bundle
notification-bundle copied to clipboard
Add examples in documentation
Add use case example and integration examples (eg JS dropdowns)
Hello Maximillien,
Your bundle seems very cool, and I'd like to use it, but it suffer of a lack of documentation; especially a full example.
I've tried to implement the twig function {{ mgilet_notification_render(notifiableEntity) }}
but how did you really used it ? especially if notifiableEntity
is in a user namespace ?
Please have in mind that a doc should be a highest priority than a new major version (my point of view).
BTW, thanks for your work. Laurent
Hi Laurent,
The function {{ mgilet_notification_render(notifiableEntity) }}
will render a simple ul
li
list of notifications. You can override the view or use a custom view.
See here for more details.
I think more documentation is needed but I currently don't have much time for this.
If you want to add more example and details, feel free to submit a pull request.
Thanks for using the bundle 😄
Hello Maximilien,
Finally I've tested it yesterday, and I like it. Even if it was difficult to understand how to use it. Finally nothing is impossible !
When I'll finish my current learn steps, I'll propose a full example (to contribute). Thanks for your reply
I made a simple demo repository for sample implementation. It's running Symfony 4 and uses the dev branch of the bundle (working on it to get full compatibility with flex).
https://github.com/maximilienGilet/notification-bundle-demo
Thanks for sharing this Maximilien. I'll have a look later on this demo repo !
Thank you Maximilien for creating and sharing this bundle. Nice work. I've checked the documentation and the demo bundle you've created, but I still do not understand how to use the events? I do receive the events in a custom created listener, but after receiving the JSON response I would like to return to the page/controller/route. How can I do that?
Kind regards
Hi @PDirkx thanks for using this bundle !
In order to use the events provided by the bundle, you can create an EventListener or an EventSubscriber.
Symfony documentation : https://symfony.com/doc/current/event_dispatcher.html
:)
Hello I want to add a notification sound when a user places an order on an e-commerce application I want to know if this bundle is responding to my need, if yes have you an example.
@llaville please can you share me the code of twig? i want to see notifications like this gif https://camo.githubusercontent.com/aa3ef4e798bf4d2ac1aca1e6fa048f2ea40f6360/687474703a2f2f692e696d6775722e636f6d2f30374f634636632e676966
@PDirkx Are you getting this error Unable to find template "MgiletNotificationBundle::notification_list.html.twig"
cause I am. This happens in case of {{ mgilet_notification_render(user) }}
function
Notifications are getting stored but are not rendered by the function
Hello Maximilien,
Finally I've tested it yesterday, and I like it. Even if it was difficult to understand how to use it. Finally nothing is impossible !
When I'll finish my current learn steps, I'll propose a full example (to contribute). Thanks for your reply
Hi, I want to use this bundle for an internship but I couldn't quite understand the documentation. Can you help me with it please?
Hello, I found a probleme in display the list notification. Maximilien can you provide us with the .html.twig
Hi, @medkarim-rebey. I have used this bundle in my GSoC project and I'm ready to help you out here. You can see an example .html.twig
files inside your vendor/mgilet/notification-bundle/Resources/views directory, if you have correctly installed the bundle.
If you have any further problems, do let me know. Thanks!
Hi,@aquibbaig ,I'm already using html.twig .the probleme is in displaying the notification by the commande {{ mgilet_notification_render(app.user) }} .I couldn't quite understand the commande. Can you help me with it ?,Thanks
{{ mgilet_notification_render(app.user) }}
is a Twig helper which can be used as a templating expression in your twig files. You can hop over to vendor/mgilet/notification-bundle/Twig/NotificationExtension.php
and check the getFunctions and render methods over there. It just does a for loop on all the notifications and renders them on a template, in this example .html.twig
file.