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

(08-06-2024, 05:56 AM)cadgiru Wrote:
(08-05-2024, 02:57 AM)kenjis Wrote: 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); 

3. By default, all GET queries are shown in the pagination links. So you don't need to do an extra work

What am I missing?
Really going in circles, what I want is to add two GET queries to pagination, resulting in something like:  example.com/myview?a=1234&b=5678&page=4.
Am struggling to find how to add the GET queries.
Thx in advance, all help appreciated
@kenjis  thx for Your persistence in trying to guide me in the right direction. Sadly I still must have missed something
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