Skip to content

Bug: pagination not working with segment #3188

Description

@mmrtonmoybd

Pagination not working with segment, but the page query parameter pagination is still working.
https://codeigniter.com/user_guide/libraries/pagination.html#specifying-the-uri-segment-for-page
In user guide says
“It is also possible to use a URI segment for the page number, instead of the page query parameter. Simply specify the segment number to use as the fourth argument. URIs generated by the pager would then look like https://domain.tld/model/[pageNumber] instead of https://domain.tld/model?page=[pageNumber].:”
In user guide given an example code

$users = $userModel->paginate(10, ‘group1’, null, 3);

I am doing same thing.
I do

$data = [
         'get' => $post->where('status', 1)->where('admin_status', 1)->where('category', $category)->orderBy('pid', 'desc')->paginate(4, 'default', null, 4),
         'pager' => $post->pager
         ];

But it is not working. It's show an error

TypeError
Argument 3 passed to CodeIgniter\Model::paginate() must be of the type int, null given, called in /storage/emulated/0/htdocs/code/app/Controllers/Category.php on line 14

SYSTEMPATH/Model.php at line 1140

Maybe it's a bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions