1. Go to this page and download the library: Download akkaweb/cakephp-facebook library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
akkaweb / cakephp-facebook example snippets
// NOTE: Use instructions in SDK5 Branch if this is a new installation. This branch his no longer supported.
"
public function initialize(){
parent::initialize();
$this->loadComponent('AkkaFacebook.Graph', [
'app_id' => 'your-fb-app-id',
'app_secret' => 'your-fb-app-secret',
'app_scope' => 'email,public_profile', // https://developers.facebook.com/docs/facebook-login/permissions/v2.4
'redirect_url' => Router::url(['controller' => 'Users', 'action' => 'login'], TRUE), // This should be enabled by default
'post_login_redirect' => '' //ie. Router::url(['controller' => 'Users', 'action' => 'account'], TRUE)
// 'user_columns' => ['first_name' => 'fname', 'last_name' => 'lname', 'username' => 'uname', 'password' => 'pass'] //not
sudo php composer.phar update
`
Optional Settings Array
* id -> Link id
* class -> Link class
* title -> Link title
* style -> Any html style
* label -> Hyperlink text
` echo $this->Facebook->loginLink($options = []);