我正在嘗試使用codeigniter分頁類。CodeIgniter 2.0.3分頁類起始頁
這裏是我的代碼
$this->load->library('pagination');
$config['base_url'] = base_url('language/'.$this->uri->segment(2));
$config['total_rows'] = $page_count;
$config['per_page'] = 1;
$config['num_links'] = '2';
$config['uri_segment'] = '2';
$this->pagination->initialize($config);
$data['pages'] = $this->pagination->create_links();
但隨後,在第一頁的URL會看起來像
localhost/language/something/
,而第二頁是
localhost/language/something/1
這看起來有點奇怪,是否有可能在第一頁上的URL從1開始?
感謝您的輸入,但是可以改變,而不是顯示偏移量,顯示當前頁面? –
您需要擴展(繼承)分頁庫。如果您告訴我您使用的是哪個版本的CI,我會發布代碼。 – minboost
我使用最新的一個,它應該是2.0.3 –