Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Saving Search Result for Pagination
  • Hi Guys;

    I am having problems with pagination. Actually, the documentation doesn't tell much on how to implement it. I have a search page that will display the search results. I want it broken down into pages, as they can compile a lot if there are a lot of data. 

    Following the tutorial, here is my controller (I will just paste it on pastebin for convenience):

    Here is my View

    And my Model

    The pagination displays fine as you can see:

    I also routed it on router.php since it add /:number in the uri if you click two, as intended, so I add it up.

    Of course, when I click it, I am just directed to a blank search page. I would think it is because the search parameters were not passed when I clicked two, as the $_POST is empty. 

    So what can I do to make this work? Should I change my form method to GET instead of POST? Any other things I had missed in the Model?

    Thanks.


  • I store them in session flash storage in the search method, after validation of the input. And if no post is present, and check if I can retrieve them from flash. If so, I use that to proceed, if not I redirect away with an error message ('no search criteria entered').
  • I will just dump my post Data in flash?
  • HarroHarro
    Accepted Answer
    That's what I do.

Howdy, Stranger!

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

In this Discussion