渲染过程中抛出异常?

时间:2015-08-06 11:23:36

标签: symfony twig rendering

我希望获得" PublisherId"从我的twig文件。

它返回一个错误---- 在呈现模板期间抛出了一个异常("无法生成指定路径的URL" myBundle_publisher"因此路线不存在。")

我阅读了枝条文档,在那里它也写得像我写的那样。

有谁知道我怎么能解决这个问题。真的堆叠在这里,有人可以解决这个问题,谢谢先进。

1 个答案:

答案 0 :(得分:2)

需要将路由导入为任何其他路由资源(请注意注释类型):

# import routes from a controller class
post:
    resource: "@SensioBlogBundle/Controller/PostController.php"
    type:     annotation

有关@Route

的更多信息