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

How to use this in Symfony 4.4 #70

Closed
easternmayurt opened this issue Dec 10, 2019 · 3 comments
Closed

How to use this in Symfony 4.4 #70

easternmayurt opened this issue Dec 10, 2019 · 3 comments

Comments

@easternmayurt
Copy link
Contributor

easternmayurt commented Dec 10, 2019

Hi @marcelglaeser @avramcosmin @emulienfou @matthieumota @Viperoo @4ssil @maximilienGilet I am new in Symfony and trying to use this notification bundle in my project but didn't get proper configurations steps for Symfony 4.4 can anyone in the group please help me. #HELP REQUIRED

@easternmayurt
Copy link
Contributor Author

easternmayurt commented Dec 10, 2019

Screenshot from 2019-12-10 20-14-34
Now I got this error, can anyone of you please help me.
I have changed in the Entity added

@Notifiable(name="user")

bind notification bundle inside services.yaml

bind:
            Mgilet\NotificationBundle\Manager\NotificationManager : "@mgilet.notification"
mgilet.twig_extension:
        class: Mgilet\NotificationBundle\Twig\NotificationExtension
        arguments: ['@mgilet.notification', '@security.token_storage', '@twig', '@router']

Inside controller added following below-mentioned function

public function sendNotification(\Mgilet\NotificationBundle\Manager\NotificationManager $manager)
    {
        $notif = $manager->createNotification('New Test');
        $notif->setMessage('Test');
        $notif->setLink('http://symfony.com/');
        $manager->addNotification([$this->getUser()], $notif, true);

        return $this->redirectToRoute('currencies');
    }

What else is missing here ?

@emulienfou
Copy link
Contributor

HI @easternmayurt this bundle is not yet compatible with SF4.4, it still use deprecated classes like Twig_SimpleFunction.
If you want to use it with SF4.4 you will have to upgrade the TwigExtension class and probably other classes.
Pull Request is welcomed

@easternmayurt
Copy link
Contributor Author

Thanks for the reply @emulienfou, I will trying to fix it if you can help me out, where I need to maily, because as I am new with the SF so its a bit time taken process to check everything and upgrade. I appreciate if you just let me know what are the main libraries which I need to upgrade.

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

No branches or pull requests

2 participants