Created
May 9, 2014 05:08
-
-
Save tvalentius/11d6655347fb57ad3a14 to your computer and use it in GitHub Desktop.
Testing Laravel4 Facebook connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HomeController extends BaseController { | |
public function getIndex() | |
{ | |
//model | |
$application = array( | |
'appId' => '14111457991XXXXX', | |
'secret' => '8580590eb169026ebcba845bf35XXXXX' | |
); | |
$permissions = 'publish_stream'; | |
$url_app = 'https://XXXXX.com/public'; | |
$getUser = ''; | |
$fb = FacebookConnect::getFacebook($application); | |
$getUser = FacebookConnect::getUser($permissions, $url_app); // Return facebook User data | |
//viewdata | |
$this->viewdata['home_data'] = $getUser; | |
//view | |
$this->layout->nest('content', 'home.index', $this->viewdata); | |
} | |
public function getMenu() | |
{ | |
//$fb = FacebookConnect::getFacebook($application); | |
$getUser = FacebookConnect::getUser($permissions, $url_app); | |
//viewdata | |
$this->viewdata['home_data'] = $getUser['user_profile']; | |
//view | |
$this->layout->nest('content', 'home.index', $this->viewdata); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment