0
Paginator正在为第二页的页面加载404页面。问题在于这个控制器中存在_remap方法。codeigniter 2分页不适用于_remap
我的分页程序:
$this->config->load('pagination', TRUE);
$config = array_merge($this->config->item('pagination'), Array(
'base_url' => site_url() . "/welcome",
'total_rows' => count($commentsOfInterview),
'per_page' => 2,
'uri_segment' => 2,
));
$this->pagination->initialize($config);
$page = ($this->uri->segment(1)) ? $this->uri->segment(1) : 1;
$commentsList['comments'] = $this->em->getRepository('Entities\Comment')->findPageOfActive($page, $config["per_page"], 'DESC', $lastInterviewId);
$commentsList['links'] = $this->pagination->create_links();
分页程序加载,但是从2页加载404页。我怎样才能解决这个问题,而不是删除_remap?
显示您的_remap内容。 – JoDev
我添加了我的_remap。我尝试检查页面是否存在我_remap,因为当我使用_remap时,CI自己不再检查它 –
我想再添加一个,如果我的_remap将检查段(2)是否为数字,并将控制权交还给方法,但是这样,paginator的第二页将被加载。如何实现这一点? –