有人知道如何从Json数据中获取个人资料图片,我获取所有信息(usernam,firstname,FacebookId)但我无法获得我的个人资料图片链接:
namespace djepo\UserBundle\Security\User\Provider;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use \BaseFacebook;
use \FacebookApiException;
class FacebookProvider implements UserProviderInterface
{
/**
* @var \Facebook
*/
protected $facebook;
protected $userManager;
protected $validator;
....
....
public function loadUserByUsername($username)
{
$user = $this->findUserByFbId($username);
try {
$fbdata = $this->facebook->api('/me');// Here I Get all information without pic
} catch (FacebookApiException $e) {
$fbdata = null;
}
if (!empty($fbdata)) {
var_dump($fbdata);// here I see object with result of data
exit();
$user_by_mail=$this->userManager->findUserBy(array('email'=>$fbdata['email']));
.....
....
答案 0 :(得分:0)