Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: pagination not working with segment #3188

Closed
mmrtonmoybd opened this issue Jun 30, 2020 · 0 comments
Closed

Bug: pagination not working with segment #3188

mmrtonmoybd opened this issue Jun 30, 2020 · 0 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@mmrtonmoybd
Copy link
Contributor

mmrtonmoybd commented Jun 30, 2020

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.

@mmrtonmoybd mmrtonmoybd added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

1 participant