伊夫試圖與笨分頁,應該根據笨的手動那麼簡單,即使是在例如是這樣如何配置分頁codeigniter?
«第一< 1 2 3 4 5>最後»
$config['total_rows'] = $this->searchdesc_model->queryallrows();
$config['per_page'] = '10';
$config['uri_segment'] =4;
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$config['cur_tag_open'] = '<b>';
$config['cur_tag_close'] = '</b>';
$config['first_link'] = 'First';
$config['last_link'] = 'Last';
$config['last_tag_open'] = '<p>';
$config['last_tag_close'] = '</p>'
$this->load->library('Company_Creation');
在視圖中我只把它叫做這樣的分頁 - > create_links(); ?>(或者我通過時,我把它從控制器的觀點發送,還是我只得到這個
1 2 3>
,有沒有辦法讓它看起來像〔實施例,聽起來所以假,但任何人都可以幫我嗎?還是有相似?
感謝
編輯1
$config['total_rows'] = $this->searchdesc_model->queryallrows();
$config['per_page'] = '5';
$config['uri_segment'] =4;
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$config['cur_tag_open'] = '<b>';
$config['cur_tag_close'] = '</b>';
$config['first_link'] = ' First';
$config['last_link'] = ' Last';
$config['last_tag_open'] = '<p>';
$config['last_tag_close'] = '</p>';
$config['next_link'] = '';
$config['next_tag_open'] = '<p id="nextbutton" style="padding-left:5px;">';
$config['next_tag_close'] = '</p>';
$config['prev_link'] = '';
$config['prev_tag_open'] = '<p id="prevbutton" style="padding-right:5px;">';
$config['prev_tag_close'] = '</p>';
$config['num_links']=4;
$data['retorno'] = $this->searchdesc_model->queryalldb($config['per_page'],$this->uri->segment(4,0));
$config['total_rows']=1000;
$this->pagination->initialize($config);
一個問題,我這樣做是根據一些建議伊夫收到,就像你說的那樣,當許多數據工作的很好時,我仍然喜歡隨時顯示第一個和下一個按鈕,在我的查詢(我用正確的行數調用)之後設置了total_rows,並且之前我也嘗試過結果是一樣的,我也只需要顯示4個數字,我很討厭numb_links ...仍然不起作用(我不知道爲什麼Ci文件應該工作..)任何想法?
謝謝!
據我所知,這只是看上去什麼像分頁的例子。不是使用CodeIgniter分頁類可以創建的實際分頁。您可能需要擴展分頁類並自己調整'create_links()'方法。 – 2012-02-13 05:12:40
謝謝,有關如何由我自己創建它們的任何想法? (我討厭codeigniter給出了這些例子,他們甚至不提供如何使它的線索......) – jpganz18 2012-02-13 05:18:02
你正在使用哪個CodeIgniter版本? – 2012-02-13 05:29:19