Welcome Guest, Not a member yet? Register   Sign In
pagination adding params
#6

1. You need to use the method correctly. If you specify incorrect parameters, it does now work as you expected.
2. Try the sample code in the User Guide to understand how the code works.
3. By default, all GET queries are shown in the pagination links. So you don't need to do an extra work.

PHP Code:
        $pager service('pager');

        $page    = (int) ($this->request->getGet('page') ?? 1);
        $perPage 20;
        $total  200;

        // Call makeLinks() to make pagination links.
        $pager_links $pager->makeLinks($page$perPage$total);

        $data = [
            // ...
            'pager_links' => $pager_links,
        ];

        return view('users/index'$data); 
Reply


Messages In This Thread
pagination adding params - by cadgiru - 08-03-2024, 06:20 AM
RE: pagination adding params - by ozornick - 08-03-2024, 10:45 AM
RE: pagination adding params - by cadgiru - 08-04-2024, 11:28 PM
RE: pagination adding params - by kenjis - 08-05-2024, 12:39 AM
RE: pagination adding params - by cadgiru - 08-05-2024, 02:26 AM
RE: pagination adding params - by kenjis - 08-05-2024, 02:57 AM
RE: pagination adding params - by cadgiru - 08-06-2024, 05:56 AM
RE: pagination adding params - by cadgiru - 08-06-2024, 11:27 PM
RE: pagination adding params - by kenjis - 08-06-2024, 06:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB