Symfony/FOSFacebook - 无法为命名路由生成 URL "fos_facebook_channel"



在我的Symfony2项目中集成FOSfacebookBundle后,我在尝试执行我的项目时得到这个错误:

An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "fos_facebook_channel" as such route does not exist.") in MyBundle::layout.html.twig at line 32. 

第32行:

{{ facebook_initialize({'xfbml': true, 'fbAsyncInit': 'onFbInit();'}) }}

我刚刚检查了fo_facebook_channel是否在文件FOS/FacebookBundle/Resources/config/routing.xml中有路由,它确实有:

<route id="fos_facebook_channel" pattern="/channel.html">
    <default key="_controller">FOSFacebookBundle:Facebook:channel</default>
    <requirement key="_method">GET</requirement>
</route>

尝试添加

fos_facebook_channel: resource: "@FOSFacebookBundle/Resources/config/routing.xml"

appconfigrouting.yml文件

相关内容

  • 没有找到相关文章

最新更新