In this example, we will use the CI built-in model to retrieve data from Facebook.
The example displays a Facebook user name and picture and displays the user's Facebook friends.
This example uses Facebook PHP SDK as a CI library. It can be downloaded from https://github.com/facebook/php-sdk. For more information, refer to Chapter 4, Libraries.
This example will be constructed from the following controllers, model, and view:
application/controllers/fbpage.php
: This controller loads the modelfbmodel
$this->load->model('fbmodel')
: This controller renders the viewfbview
, which displays the user's Facebook picture and name, and table, which contains the user's friends' names and links to their profilesapplication/models/fbmodel.php
: This model contains functions that retrieve data from Facebookapplication/views/fbview.php
: This view displays Facebook data
Let us assume the URI to the project root is http://mydomain.com/myproject
and http://mydomain...