-
- function createLinkGenerator($links) {
- return function($which) use($links) {
- if (!isset($links[$which])) {
- if ($which !== "next" || !isset($links["last"])) {
- return null;
- } else {
- $which = "last";
- }
- }
- $url = new Url($links[$which], null, 0);
- $qry = new QueryString($url->query);
- return $qry->getInt("page", 1);
- };
- }
-