嘿,夥計們。我的Codeigniter項目中存在分頁問題。我正在使用分頁庫,並且我有一個搜索表單。當我搜索某些內容時,結果顯示在頁面上。當結果行超過限制時,我會顯示分頁鏈接。但是當我點擊鏈接號碼2進入第二頁時,分頁鏈接消失。我的搜索代碼如下...分頁鏈接在第二頁上消失 - codeigniter
控制器功能:
function search_branch()
{
$this->load->library('pagination');
$search_this=$this->input->post('inputsearchbranch');
$limit = 20;
$data['fields'] = array(
'branch_name' => 'Branch Name',
'city'=>'City',
'district'=>'District',
'tahsil'=>'Tahsil',
'Branch_manager'=>'Branch Manager'
);
$this->load->model('mod_user');
$searchbranch=$this->mod_user->search_branch($search_this,$limit);
$data['searchbranch'] = $searchbranch;
$config = array();
$config['base_url'] = site_url("ctl_home/search_branch/");
$config['total_rows'] = count($searchbranch);
$config['per_page'] = $limit;
$config['uri_segment'] = 3;
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$this->load->view('view_searchbranch',$data);
}
我的觀點:
<center>
<form class="userinfo" action="" method="post">
//table in which search record display
</form>
</center>
<?php if (strlen($pagination)): ?>
<div class="pagination">
<?php echo $pagination; ?>
</div>
<?php endif; ?>
什麼是你的第二個網址頁? – 2013-04-23 04:37:21
@PathikGandhi:'http:// localhost/kccs/index.php/ctl_dbcont/receiptts/receipt_date/asc/20'看起來不對。 。 – Jay 2013-04-23 04:39:03
你可以發佈你的search_branch模型嗎?也許問題出在那裏。 – pat 2013-04-23 07:26:27