Codeigniter分页链接不适用于Boostrap分页类

时间:2018-11-10 08:15:20

标签: codeigniter

使用引导程序类“ pagination”创建的分页链接不起作用。在不添加引导类的情况下创建的链接可以正常工作。这是我的控制器代码

    $config ['base_url'] = base_url () .'adv/index';
    $config ['total_rows'] = $result->num_rows();
    //$config ['uri_segment'] = $segment;
    $config ['per_page'] = 5;
    $config ['num_links'] = 5;

    $config['full_tag_open'] = '<ul class="pagination">';
    $config['full_tag_close'] = '</ul>';
    $config['first_link'] = false;
    $config['last_link'] = false;
    $config['first_tag_open'] = '<li class="page-item">';
    $config['first_tag_close'] = '</li>';
    $config['prev_link'] = '&laquo';
    $config['prev_tag_open'] = '<li class="page-item prev">';
    $config['prev_tag_close'] = '</li>';
    $config['next_link'] = '&raquo';
    $config['next_tag_open'] = '<liclass="page-item">';
    $config['next_tag_close'] = '</li>';
    $config['last_tag_open'] = '<liclass="page-item">';
    $config['last_tag_close'] = '</li>';
    $config['cur_tag_open'] = '<li class="page-item active"><a href="page-link">';
    $config['cur_tag_close'] = '</a></li>';
    $config['num_tag_open'] = '<li class="page-item">';
    $config['num_tag_close'] = '</li>';

    $this->pagination->initialize($config);
    $data['links']=$this->pagination->create_links();
    $category=$this->adv_model->adv_get_paginated_data($segment,5);
    $data['category']=$category;
$this->global['pageTitle'] = 'Media : Communiation';
    $this->loadViews("adv_view", $this->global,$data, NULL);
[View Image][1]


  [1]: https://i.stack.imgur.com/JDcVX.png

0 个答案:

没有答案