0
我花了一些時間,但無法弄清楚什麼是錯的。我使用CodeIgniter 2.1.0。爲什麼CodeIgniter分頁鏈接膨脹?
所以基本上它是這樣的:
我的分頁設置:
$config['base_url'] = base_url() . '/stores/';
$config['total_rows'] = $this->stores_model->getTotalRows();
$config['per_page'] = 20; //display 20 rows per page
$config['num_links'] = 10; //display 10 pagination links
$config['uri_segment'] = 2;
$config['full_tag_open'] = '<div id="pagination">';
$config['full_tag_close'] = '</div>';
$this->pagination->initialize($config);
我越來越喜歡這個數據塊從控制器。哪一個也有效。
$data['stores'] = $this->stores_model->getChunks($config['per_page'], $this->uri->segment(2));
我的看法頁面有:
<?php echo $this->pagination->create_links(); ?>
現在一切工作正常。首先顯示10個分頁鏈接,但是當我點擊鏈接8,9或10等時,分頁鏈接膨脹。它現在顯示鏈接1到20.爲什麼?這可能是非常簡單的事情,但似乎無法弄清楚。我期待的滾動分頁鏈接類型,但只顯示10個鏈接,因爲我已經在配置中設置。
感謝和問候
迪帕克