Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Problem with pagination
  • Hello,

    I have a problem with the pagination on one of my pages. I access the page with the url http://page.com/pro/attempts/2?page=3 , in the controller action I configured the pagination as follows:

    $config = array(
       'total_items'    => $attempts->count(),
       'per_page'       => 25,
       'uri_segment'    => 'page',
    );

    The problem is that when the page is shown the table of data shows the second page and the pager at the bottom also shows that I am on the second page and not the third as specified in the URL.
  • That is weird. Are you sure there is data for a third page?

    Pagination will check if that is the case, and if so it will adjust  the page counter.
  • Yes, there is data..it does not mater what page I request it always jumps to the second page.

    Another example is: http://page.com/pro/attempts/9?page=3 here there is enough data for 5 pages and when I request this URL the pager jumps to the last (5-th) page instead of showing the third page.

    It is ignoring the GET parameter and using the ID for the pager.
  • Which Fuel version are you on?
  • I'm on version 1.5
  • Then it's time for an upgrade, or if not possible, backport the pagination class from the current release.

    The old version was riddled with bugs, it was rewritten for I think 1.6.

Howdy, Stranger!

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

In this Discussion