我想通过api facebook和框架codeigniter对facebook的朋友进行分页。
// ID & APP SECRET CONNECTION
$this->load->library('facebook');
$fb_id = $this->facebook->getUser();
if($fb_id){
try{
//get the facebook friends list
$user_friends = $this->ci->facebook->api('/'.$fb_id.'/friends');
}catch(FacebookApiException $e){
error_log($e);
$user_friends = NULL;
}
}
if (!is_null($user_friends)) {
// pagination - how can i do that?
$data['list_friends'] = $user_friends;
$this->load->view('list_friends',$data);
} else {
echo "error";
}
查看
<?php
foreach ($list_friends['data'] as $friend) {
echo $friend['name'];
}
?>
我如何进行分页或我必须使用的逻辑呢?