Php simple paging class | page. class. php simple and easy to use PHP paging class
2) {$ url = self: url (1); return"
Homepage";}} Public static function previous () {if (self: $ page> 1) {$ url = self: url (self: $ page-1 ); return"
Previous Page";}} Public static function number () {$ str =''; $ f = self: $ number % 2? (Self: $ number-1)/2: self: $ number/2; $ s = self: $ page-$ f; $ e = self :: $ page + $ f; if (self: $ page <($ f + 1) {$ s = 1; $ e = self: $ number; $ e = $ e> self: $ max? Self: $ max: $ e;} if (self: $ page> (self: $ max-$ f) {$ s = self :: $ max-self: $ number; $ s = $ s <1? 1: $ s; $ e = self: $ max;} for ($ I = $ s; $ I <= $ e; $ I ++) {$ url = self: url ($ I); if ($ I = self: $ page) $ str. ="
{$ I}"; Else $ str. ="
{$ I}";}Return $ str;} public static function next () {if (self ::$ page <self ::$ max) {$ url = self :: url (self:: $ page + 1); return"
Next page";}} Public static function end () {if (self: $ max-self: $ page)> 1) {$ url = self: url (self:: $ max); return"
Last page";}} Public static function url ($ page) {return str_replace ('{page}', $ page, self: $ url );}}