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

  authentication, captcha, listener, php, symfony

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

LEAVE A COMMENT