如何在symfony中的php代码中使用Swift-mailer
我正在使用这个,但我得到了错误如何在symfony中的php代码中使用Swift-mailer,php,symfony,doctrine-orm,Php,Symfony,Doctrine Orm,我正在使用这个,但我得到了错误 foo_bundle.listener.comment: class: xxx\Listener\CupleListener arguments: [@mailer] 这是一个错误 另外,我不知道要在名称空间顶部包含哪个类,请尝试: public function __construct(\Swift_Mailer $mailer) { $this->mailer = $mailer; } 尝试: public
foo_bundle.listener.comment:
class: xxx\Listener\CupleListener
arguments: [@mailer]
这是一个错误 另外,我不知道要在名称空间顶部包含哪个类,请尝试:
public function __construct(\Swift_Mailer $mailer)
{
$this->mailer = $mailer;
}
尝试:
public function __construct(\Swift_Mailer $mailer)
{
$this->mailer = $mailer;
}
它说的是Mybundle\Swif\u mailer的预期实例,但给出了Swiftmailer的实例。它说的是Mybundle\Swif\u mailer的预期实例,但给出了Swiftmailer的实例