在我的 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();'}) }}
我刚刚检查了 fos_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>