本文整理匯總了PHP中Facebook\FacebookRequest::getParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP FacebookRequest::getParams方法的具體用法?PHP FacebookRequest::getParams怎麽用?PHP FacebookRequest::getParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Facebook\FacebookRequest
的用法示例。
在下文中一共展示了FacebookRequest::getParams方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAVideoCanBeAddedToParams
public function testAVideoCanBeAddedToParams()
{
$myFile = new FacebookVideo(__DIR__ . '/foo.txt');
$params = ['name' => 'Foo Bar', 'source' => $myFile];
$app = new FacebookApp('123', 'foo_secret');
$request = new FacebookRequest($app, 'foo_token', 'POST', '/foo/videos', $params);
$actualParams = $request->getParams();
$this->assertTrue($request->containsFileUploads());
$this->assertTrue($request->containsVideoUploads());
$this->assertTrue(!isset($actualParams['source']));
$this->assertEquals('Foo Bar', $actualParams['name']);
}
示例2: sendRequest
public function sendRequest(FacebookRequest $request)
{
$params = $request->getParams();
$rawResponse = json_encode(['access_token' => 'foo_access_token_from:' . $params['code']]);
return new FacebookResponse($request, $rawResponse, 200);
}