我在routes.php as中配置了一条路由,
$route['job-history/(:num)'] = "customer/customer/jobhistory/$1";和控制器中的分页配置,如下所示
$this->load->library('pagination');
$config['per_page'] = 25;
$config['total_rows'] = 100;
$config['base_url'] = $this->config->item('base_url').'job-history';
$config["uri_segment"] = 2;
$this->pagination->initialize($config);
$page = ($this->uri->segment(2)) ? $this->uri->segment(3) : 0;加载时显示404错误页面,
www.example.com/job-history
如果手动添加一个零,比如www.example.com/job-history/0,它就会起作用。
如何加载www.example.com/job-history作为第一页。我的排泄物出了什么问题。请帮个忙
发布于 2013-04-12 17:32:30
您还需要一条用于单个job-history网段的路由。
$route['job-history/(:num)'] = 'customer/customer/jobhistory/$1';
$route['job-history'] = 'customer/customer/jobhistory';发布于 2013-04-12 17:56:07
由于在route.php中,您只提到了后面有编号段的作业历史页面,并且没有仅针对您的页面作业历史的规则,因此它将被重定向到404。
添加
$route['job-history'] = 'customer/customer/jobhistory';在此之前
$route['job-history/(:num)'] = 'customer/customer/jobhistory/$1';https://stackoverflow.com/questions/15967141
复制相似问题