简体   繁体   中英

Symfony/FOSFacebook - Unable to generate a URL for the named route “fos_facebook_channel”

After integrating the FOSfacebookBundle in my Symfony2 project, I get this error when trying to execute my project:

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. 

This is the line 32:

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

I just checked if the fos_facebook_channel does have a route in the file FOS/FacebookBundle/Resources/config/routing.xml and it does:

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

Try to add

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

to your app\\config\\routing.yml file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM