CodeIgniter分页页面链接不起作用

Tes*_*ter 1 php pagination codeigniter

我在我的codeigniter应用程序中使用分页类.分页链接显示正常,即,我想正确数量的链接,例如.1 2 3 4 5>,页面加载了我每页指定的条目数量.

错误是当我点击其中一个链接转到下一组条目时,它显示"无法找到页面".

控制器:

public function index()
    {

      $config["base_url"] = base_url().'tester';

            $config["total_rows"] = $this->test_model->count_entries();

            $config["per_page"] = 3;

            $config['uri_segment'] = 2;

            $config["num_links"] = 10;

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

         $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;
         $q1=$this->test_model->get_entries($config["per_page"],$page);
             $links = $this->pagination->create_links();
}
Run Code Online (Sandbox Code Playgroud)

该模型:

public function count_entries() {

        $this->db->where('approved', 0);
        $this->db->from('tested');

        return $this->db->count_all_results();

    }

public function get_entries($limit, $start)
    {
         $this->db->limit($limit, $start);

        $this->db->where('approved', 0);

$q = $this->db->get('tested');
$data = $q->result_array();
        return  $data;
    }
Run Code Online (Sandbox Code Playgroud)

页面的URL是http://localhost:8080/CIAPP/tester,http://localhost:8080/CIAPP/在我的配置文件中设置为我的base_url.CIAPP是应用程序目录,tester是我的控制器.

当我点击任何分页链接时会发生错误,该链接指向http://localhost:8080/CIAPP/tester/3"未找到页面"的URL .

当我点击链接2时,网址为/ 3,当我点击链接3时,网址为/ 6.我想这是因为我每页指定3个.

如何解决此问题,以便在单击分页链接时,具有相应条目的页面会加载?

小智 5

CIAPP - 应用程序目录测试器 - 控制器类

你在测试仪里面使用任何功能吗???

如果那样的话

BASE_URL() '测试器/函数名'.