Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Bootstrap public/index.php
- use Phalcon\Logger,
- Phalcon\Db\Adapter\Pdo\Mysql as Connection;
- require_once '/../vendor/autoload.php';
- error_reporting(E_ALL);
- try {
- $di->setShared('facebook', function() use ($config) {
- return new \Facebook([
- 'appId' => $config->facebook->appId,
- 'secret' => $config->facebook->secret,
- ]);
- });
- //Session Controller
- use Phalcon\Tag as Tag;
- class SessionController extends ControllerBase
- {
- public function facebookAction()
- {
- FacebookSession::setDefaultApplication('xxx', 'xxx');
- $helper = new FacebookRedirectLoginHelper('index/index');
- $loginUrl = $helper->getLoginUrl();
- // 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