Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Pagination class with GET query variables
  • How about adding some functionality to pagination class? I bet some people would like to use pagination with query variables like:
  • Ok, still work in progress, but i modified Pagination class to accept GET variables.
    Here: (can't send pull request, says that fork is up to date with main branch, going to contact support) Last two commits (still needs small bugfix).
    Input class also has to be updated to be able to use

    How it works/
    Same as described in docs, but:
    'pagination_url' should be just segments - you don't have to include stuff like "?page=2".
    you also have to set query_variable like so:
    'query_variable' => 'page'

    In case if user has several GET query variables:
    all of variables will be saved and added automatically.
    For example let's say we have this page:

    if you'll go to the next page in blog, "comments" variable still will be there:

  • Ok, same link, 3 commits: Looks like it works.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion