Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在symfony中的php代码中使用Swift-mailer_Php_Symfony_Doctrine Orm - Fatal编程技术网

如何在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的实例