Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Even page has changed,want to keep input value for search result pagination
  • In ORM pagination,input value from search input is can only save the first page.When go to the next page the input value was not in search and search result also change.I want to keep input value for next page pagination.
  • Either store the search operation in session flash, and retrieve it at the next page load, or set the pagination URL including the search values as part of the query string.
  • How can i do it this with de Session flash?
    Thanks
  • See https://fuelphp.com/docs/classes/session/usage.html#/method_set_flash (and it's compagnion get_flash).

    When the action is called, and no search value is posted, call get_flash() to see if there is a search value stored in the session, and if so, use that. 

    Validate the search value (no matter where it came from), and when validated, store it in the session again using set_flash() so it's ready for the next page.

    Note that this doesn't work if you would like to be able to have multiple tabs or windows open with the same search page, but different criteria. If so, it's better to use the query string to pass it.

Howdy, Stranger!

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

In this Discussion