daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jun 27th, 2014 363 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Bootstrap public/index.php
  2.  
  3.  
  4. use Phalcon\Logger,
  5.     Phalcon\Db\Adapter\Pdo\Mysql as Connection;    
  6.  
  7. require_once '/../vendor/autoload.php';
  8.  
  9.  
  10. error_reporting(E_ALL);
  11.  
  12. try {
  13.  
  14.          $di->setShared('facebook', function() use ($config) {
  15. return new \Facebook([
  16. 'appId' => $config->facebook->appId,
  17. 'secret' => $config->facebook->secret,
  18. ]);
  19. });
  20.  
  21.  
  22.  
  23. //Session Controller
  24.  
  25. use Phalcon\Tag as Tag;
  26.  
  27. class SessionController extends ControllerBase
  28. {
  29.  
  30.  public function facebookAction()
  31.     {
  32.            FacebookSession::setDefaultApplication('xxx', 'xxx');
  33.  
  34.  
  35.         $helper = new FacebookRedirectLoginHelper('index/index');
  36.         $loginUrl = $helper->getLoginUrl();
  37.         // Use the login url on a link or button to redirect to Facebook for authentication
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top