也许有人可以帮助我。我在项目fos_user_bundle
中使用Symfony 4
。我在service.yaml
中覆盖了EmailConfirmationListener,但是有一个错误:
Cannot autowire service "App\EventListener\EmailConfirmationListener":
argument "$mailer" of method "__construct()" references interface
"FOS\UserBundle\Mailer\MailerInterface" but no such service exists. You
should maybe a
lias this interface to one of these existing services:
"App\Mailer\Mailer", "send_mail", "fos_user.mailer.default",
"fos_user.mailer.twig_swift", "fos_user.mailer.noop".
请参见下面的services.yaml
文件:
fos_user.listener.email_confirmation:
class: App\EventListener\EmailConfirmationListener
arguments:
- '@send_mail'
- '@fos_user.util.token_generator'
- '@router'
- '@session'
tags:
- { name: kernel.event_subscriber }
send_mail:
class: App\Mailer\Mailer
arguments:
- '@mailer'
- '@router'
- '@templating'
-
confirmation.template: '%fos_user.registration.confirmation.template%'
resetting.template: '%fos_user.resetting.email.template%'
from_email:
confirmation: '%fos_user.registration.confirmation.from_email%'
resetting: '%fos_user.resetting.email.from_email%'
请帮帮我,我做错了什么?