|
function createPagination($argument)
{
$paginationDatas = array();
$config['base_url'] = $this->getFixedURL($argument['base_url']);
$config['first_link'] = '|‹第一页';
$config['prev_link'] = '‹‹前一页';
$config['next_link'] = '下一页››';
$config['last_link'] = '最后一页›|';
$config['cur_tag_open'] = '<a class="p_curpage">';
$config['cur_tag_close']= '</a>';
$config['num_links'] = $argument['num_links'];
$config['uri_segment'] = $argument['uri_segment'];
$config['total_rows'] = $argument['total_rows'];
$config['per_page'] = $argument['per_page'];
$this->load->library('pagination');
$this->pagination->initialize($config);
$paginationDatas['pagination'] = $this->pagination->create_links();
// validate the pagination start
if($this->uri->segment($argument['uri_segment']) > $argument['total_rows']){
$page = (int)($argument['total_rows']/$argument['per_page']);
}elseif(is_numeric($this->uri->segment($argument['uri_segment']))){
$page = $this->uri->segment($argument['uri_segment']);
}else
$page = 0;
$paginationDatas['start'] = $page;
$paginationDatas['offset'] = $argument['per_page'];
return $paginationDatas;
}//end method.
第一个问题:$config['uri_segment']这个怎么理解,比如设置$config['uri_segment']=3;
第二个问题:$this->uri->segment 这里的uri是什么,怎么理解这个语句
第三个问题:$this->pagination->create_links() ,create_liniks() 是怎么理解的 |
|