How inject controller to event listener in Symfony 3 [duplicate]

I have defined listener in services.yml:

security.authentication.listener.form:
class: AppBundleListenersUsernamePasswordFormAuthenticationListener
parent: security.authentication.listener.abstract
abstract: true
calls: [ [setEntityManager, ["@doctrine.orm.entity_manager"]] ]

How i can inject class abstract class Controller in namespace SymfonyBundleFrameworkBundleController;?

I need this listener because i want google captcha chceck before user login. Controller i need inject because i would like use methods like ->redirect() and ->addFlash() in case invalid google captcha.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *