Pagination with URI segment |
Hello all
I am writing a simple blog application and want to have a pagination like the following: https://sampleblog.local/posts/page/2 Default pagination is like: https://sampleblog.local/posts?page=2 I have read the documentation : https://codeigniter4.github.io/CodeIgnit...t-for-page But still cannot implement it. I would appreciate it if anyone can provide a sample code. My controller: PHP Code: $data['articles'] = $posts->orderBy('id','DESC')
$model->paginate(5, 'default', null, 3);
Set last parameter as segment number (test 2 or 3) |
Welcome Guest, Not a member yet? Register Sign In |