Advertisement
Guest User

Untitled

a guest
Jun 27th, 2014
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement