相关疑难解决方法(0)

没有请求的Symfony2模板化

我正在尝试从ContainerAwareCommandSymfony2 发送一封电子邮件.但是,当电子邮件模板呈现时,我得到此异常:

$body = $this->templating->render($template, $data);
Run Code Online (Sandbox Code Playgroud)

例外:

 ("You cannot create a service ("templating.helper.assets") of an inactive scope ("request").") 
Run Code Online (Sandbox Code Playgroud)

我在github中发现这个帮助器需要请求对象.有人知道如何实例化Request对象?

symfony

8
推荐指数
2
解决办法
4161
查看次数

标签 统计

symfony ×1