草庐IT

object-graph

全部标签

php - Facebook graph api 访问 token 中没有电子邮件

在使用facebookgraphapi验证用户时,成功登录后,我想获取用户电子邮件。为此,我提出了用户数据请求:https://graph.facebook.com/me?access_token=xxxxxxxxxx但令我惊讶的是,我无法在json输出中获取用户的电子邮件...我怎样才能得到电子邮件?我们需要指定任何权限吗? 最佳答案 你必须强制它,像这样:...graph.facebook.com/me?**fields=email,name**&access_token...然后你可以使用对象user->email

php - 第 6 行的 fatal error : Call to a member function get() on a non-object in C:\wamp\www\ci\application\models\site_model. php

你好,我刚看了Nettuts上的第一个/第1天截屏视频“来自scracth的CodeIgniter”,我已经遇到了一个我不明白的错误。这是屏幕截图http://i39.tinypic.com/14mtc0n.jpg我的models\site_model.php中的代码和截屏是一样的models\site_model.phpclassSite_modelextendsCI_Model{functiongetAll(){$q=$this->db->get('test');if($q->num_rows()>0){foreach($q->result()as$row){$data[]=$ro

PHP : Best way to call an object method from another object ?

我正在寻找从另一个类调用类方法的最佳方法,而不必使用Global来获取类实例,因为我现在明白“全局是邪恶的”!下面是一些代码来解释它:classAssets{public$assets=array();publicfunctionadd($asset){$this->assets[]=$asset;}}现在我想在这里调用Assets/call方法..$assets=newAssets;classForm{publicfunction__construct(){global$assets;$assets->add('Form');}}在这种情况下使用Global是不是很糟糕?如果是这样,

教你看懂Git的Graph图

前言在我们常见的Git客户端(Sourcetree、TortoiseGit等)都会展示Git的Graph图,类似于下图。不知道大家是不是跟我一样,虽然使用Git多年了,但是看不太懂Git的Graph图。最近阅读了下《ProGit》这本书,对Git的理解又深入了一步。其实只要理解了Git的原理,看懂Graph图就很简单了。下面我会分别向大家介绍Git中重要的两个概念:Git提交对象和Git分支。Git提交对象Git保存的不是文件的变化或者差异,而是一系列不同时刻的快照。在进行提交操作时,Git会保存一个提交对象(commitobject)。知道了Git保存数据的方式,我们可以很自然的想到——该提

PHP 可捕获 fatal error : Object of class could not be converted to string

我完全迷失在这里......在验证一些输入后,我创建了一个Message类的实例并尝试将数据插入数据库://sendmessage$message=$this->model->build('message',true);$message->insertMessage($uid,$user->user_id,$title,$message);插入的方法非常简单://insertanewmessagepublicfunctioninsertMessage($to_id,$from_id,$title,$body){$sql="INSERTINTOmessages(to_id,from_id

php - Facebook Graph API - 如何使用新行发布到墙上?

我正在玩FacebookGraphAPI,但我遇到了一个问题-我无法找到任何方法来使用一些HTML代码或新行发布到墙上。怎么做到的?这是我的代码FACEBOOK_APP_ID,'secret'=>FACEBOOK_SECRET_KEY));$user=$facebook->getUser();$loginUrl=$facebook->getLoginUrl(array('scope'=>'email,publish_stream,user_birthday,user_location,user_about_me,user_hometown'));if(!$user){echo"top.

php - CodeIgniter 自定义库错误 : Call to a member function on a non-object

我正在尝试构建一个自定义库,其中包含可在整个站点中使用的功能。在/application/libraries我创建了一个新文件CustomFuncts:ci=&get_instance();}/***@briefcheckCookie**Checksforapreviouscookie,andifexists:*@liLoadsuserdetailstoCISessionobject.*@liRedirectstothecorrespondingpage.**/publicfunctionverificaCookie(){$this->ci->load->view('index');}

php - 为什么我的 PHP 数组给我 "Cannot use object of type stdClass as array"?

任何人都可以在这里提供帮助,我正在使用一个数组来拆分一些数据,并且在附加到的View上我收到了上面的错误。这是我的代码:用于ajaxView的PHP:$images=array();$data_link=array();$data_id=array();$data_likes=array();$data_text=array();foreach($mediaas$data){//dd($data->caption);$images[]=array(//dd($data->caption),"data_url"=>$data->images->standard_resolution->u

php - 我将如何读取此数组 ("stdClass Object")

我正在使用QuizletAPI2.0,对此我还很陌生我如何从这样的东西中读取值:stdClassObject([id]=>102269[name]=>LearnSpanishwithCats![set_count]=>3[user_count]=>10[created_date]=>1308035691[is_public]=>1[has_password]=>[has_access]=>1[has_discussion]=>1[member_add_sets]=>1[description]=>ThissetisexclusivelyforSpanishflashcardsetswi

php - 如何使用 Facebook Graph API 将照片上传到相册

代码如下:$file='bbbb.jpg';$data=array(basename($file)=>"@".realpath($file),"caption"=>"Uploadedusinggraphapi","aid"=>'13595',"access_token"=>$accessToken,'method'=>'photos.upload');$sds=$facebook->api($data);这是错误UncaughtCurlException:26:failedcreatingformpostdata怎么办? 最佳答案