分页列表朋友脸书与codeigniter

时间:2013-10-23 12:54:32

标签: php facebook codeigniter facebook-graph-api pagination

我想通过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'];
   }

?>

我如何进行分页或我必须使用的逻辑呢?

0 个答案:

没有答案