分页不适用于我的应用程序 - CodeIgniter

我已经能够为我的页面开发一个分页,其中包含大约 25000 条记录。该页面分页为 100,但现在,当我单击分页链接移至下一页时,它再次将我带到第一页。但是我浏览器上的 URI 显示为per page numberlike customers/100。我在下面做错了什么


控制器


    $config['base_url'] = base_url() . 'customers/index/';

    $config["total_rows"] = $customers

    $config["per_page"] = 100;

    $config['num_links'] = 10;

    $config["uri_segment"] = 3;


    $this->pagination->initialize($config);


    $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;


    $data['items'] = $this->customer->get_customer_all($config["per_page"]);

模型


public function get_customer_all($limit = null) {

        $this->db->select('*');

        $this->db->from('courses');           


        if($limit!=''){

            $this->db->limit($limit);

         }

        $query  = $this->db->get();


        return ($query) ? $query->result() : false;

    }


忽然笑
浏览 130回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP