-1
    $pagination_config['per_page'] = 10; 
    $pagination_config['total_rows'] = 100; 
    $pagination_config['anchor_class'] = 'class="page gradient"';
    $pagination_config['cur_tag_open'] = '<a class="page active">';
    $pagination_config['cur_tag_close'] = '</a>';
    $pagination_config['full_tag_open'] = '<div class="pagination">';
    $pagination_config['full_tag_close'] = '</div>';
    $pagination_config['first_link'] = 'First';
    $pagination_config['last_link'] = 'Last';
    $pagination_config['num_links'] = 5;

所以这很好用,但正如你所见,如果页面超过 5 页,我只在页面中显示 5 个页码,我想在最后一页按钮之前显示几个点

1 2 3 4 5... Lastpage

现在就像

1 2 3 4 5 Lastpage

我怎样才能做到这一点 ?

4

2 回答 2

1
$pagination_config['per_page'] = 10; 
$pagination_config['total_rows'] = 100; 
$pagination_config['anchor_class'] = 'class="page gradient"';
$pagination_config['cur_tag_open'] = '<a class="page active">';
$pagination_config['cur_tag_close'] = '</a>';
$pagination_config['full_tag_open'] = '<div class="pagination">';
$pagination_config['full_tag_close'] = '</div>';
$pagination_config['first_link'] = 'First';
$pagination_config['num_links'] = 5;

if(ceil($pagination_config['total_rows']/$pagination_config['per_page'])> 5)
    $pagination_config['last_link']    =   '.... Last';
else 
    $pagination_config['last_link']    =   'Last';

只需检查页码是否大于5。就这么简单。

于 2013-05-06T14:10:33.080 回答
0

这行得通吗?

$config['last_link'] = '...Lastpage';
于 2013-05-06T13:38:33.480 回答