Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples in documentation #16

Open
maximilienGilet opened this issue Nov 24, 2017 · 16 comments
Open

Add examples in documentation #16

maximilienGilet opened this issue Nov 24, 2017 · 16 comments

Comments

@maximilienGilet
Copy link
Owner

Add use case example and integration examples (eg JS dropdowns)

@llaville
Copy link

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

@maximilienGilet
Copy link
Owner Author

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 😄

@llaville
Copy link

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

@maximilienGilet
Copy link
Owner Author

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

@llaville
Copy link

Thanks for sharing this Maximilien. I'll have a look later on this demo repo !

@PDirkx
Copy link

PDirkx commented Dec 14, 2018

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

@maximilienGilet
Copy link
Owner Author

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

:)

@kamelaBessas20
Copy link

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.

@khaliltr
Copy link

@llaville please can you share me the code of twig? i want to see notifications like this gif
https://camo.githubusercontent.com/aa3ef4e798bf4d2ac1aca1e6fa048f2ea40f6360/687474703a2f2f692e696d6775722e636f6d2f30374f634636632e676966

@aquibbaig
Copy link

@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

@aquibbaig
Copy link

Notifications are getting stored but are not rendered by the function

@aquibbaig
Copy link

aquibbaig commented May 17, 2019

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?

@medkarim-rebey
Copy link

medkarim-rebey commented Dec 2, 2019

Hello,
I found a probleme in display the list notification. Maximilien can you provide us with the .html.twig

@aquibbaig
Copy link

aquibbaig commented Dec 2, 2019

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!

@medkarim-rebey
Copy link

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

@aquibbaig
Copy link

{{ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants