Codeigniter分页样式

时间:2019-06-18 02:46:20

标签: codeigniter

我只是需要帮助来定制codeigniter中的分页。我要使“之前”按钮和“第一个”按钮始终显示。仅当我在第二页上时才显示“之前”按钮,而当我在第三页上时才显示“第一”按钮。

图片1:这是第1页上的样子 enter image description here

图片2:在第2页上

enter image description here

图片3:第3页 enter image description here

我希望它始终像显示所有按钮的图像3一样显示。

这是我的代码:

        $config["total_rows"] = $totalRecords;
        $config["per_page"] = $limit;
        $config['use_page_numbers'] = TRUE;
        $config['page_query_string'] = TRUE;
        $config['enable_query_strings'] = TRUE;
        $config['num_links'] = 1;

        $config['first_tag_open'] = '<li class="pg-links">';
        $config['first_tag_close'] = '</li>';   

        $config['last_tag_open'] = '<li class="pg-links">';
        $config['last_tag_close'] = '</li>';                

        $config['cur_tag_open'] = '<li class="pg-links activePage">';
        $config['cur_tag_close'] = '</li>';

        $config['prev_tag_open'] = '<li class="pg-links">';
        $config['prev_tag_close'] = '</li>';

        $config['next_tag_open'] = '<li class="pg-links">';
        $config['next_tag_close'] = '</li>';

        $config['num_tag_open'] = '<li class="pg-links">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $str_links = $this->pagination->create_links();
        $links = explode('&nbsp;', $str_links);

任何想法如何做到这一点?

0 个答案:

没有答案