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的第二頁將被加載。如何實現這一點? –