Welcome Guest, Not a member yet? Register   Sign In
CI4 - Pagiantion problem
#1

Hi, i use CI4, i have some problem with the pagination library

My controller code is

Code:
//get Data
$this->_model->orderBy('id DESC')->findAll();
$currPage = $this->request->getGet('page');
$this->_data['currPage'] = ( isset($currPage) ) ? $currPage : 0;
$this->_data['data'] = $this->_model->paginate(5, 'post', $this->_data['currPage']);
$this->_data['pager'] = $this->_model->pager;
$this->_data['countAll'] = $this->_model->countAll();
$this->_render('Modules\Acp\Views\post\index', $this->_data);

In my View file:

Code:
<?= $pager->makeLinks($currPage, 5, $countAll, 'acp_pagi') ?>

It work oki when list my post item. But i have 1 problem. the pagination URL generate was: 

http://embernews.local/acp/post?listtype...91246527=2

instead of: 
http://embernews.local/acp/post?listtype=all&page=2

So how can i change the "&page_1591246527=2" to "&page=2" ??
can anyone help me?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB