Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Symfony2 项目中使用 Facebook 的 PHP-SDK 来发送通知。在控制器中获取 PHP-SDK 的最佳方法是什么?
安装和配置 FOSFacebookBundle 后,您可以在控制器中获取 PHP SDK,如下所示:
$facebook = $this->container->get('fos_facebook.api');
例如,如果登录,以下将获取 Facebook 用户 ID:
$uid = $facebook->getUser();