now the generated links are correct : posts/all/recent/all_time/1 but when I click on the links the pagination seem freezed nothing change, also theUri:segment(5) still return nothing I use fuelphp 1.5.3 (latest) and php 5.4 so what wrong with the pagination!!! thanks
Then you're controller code is wrong, it doesn't seem to pick up the page number from the URL. Switching to a query string is a workaround, it doesn't fix the problem.
The most logical option is to define the segments are controller action parameters. It's easier then using Uri::segment() to get it.
I think where you go wrong is with your understanding of what a "URI segment" is, for the different FuelPHP components.
If you consider the URI "posts/all/recent/all_time/1", for a controller (assuming that this is controller "posts", method "action_all"), this URI has 3 segments: "recent", "all_time" and "1". The controller name and method are not part of it, they are stripped from the URI when the request is routed.
For Pagination however. this URI has 5 segments: "posts", "all", "recent", "all_time" and "1". This is because Pagination sees the entire URL, it has no idea what part of it is routing information, and what part of it are URI parameters.
So, to fetch the page in the controller use Uri::segment(3), or use:
public function action_all($select = 'recent', $time = 'all_time', $page = 1) { // validate the page number is_numeric($page) or $page = 1;
// validate the other params, and use $page to fetch the paginated results }