...
简单好用的PHP分页类 出处:【爱玩电脑】http://aowana.sinaapp.com PHP ?php/** * page.class.php 分页类 * 日期:2015-04-05 * http://aowana.sinaapp.com */class page{public static $url;public static $page;public static $total;public static $size;
简单好用的PHP分页类
出处:【爱玩电脑】http://aowana.sinaapp.com
PHP
2)
{
$url = self::url(1);
return "
首页";
}
}
public static function previous()
{
if (self::$page > 1)
{
$url = self::url(self::$page - 1);
return "
上一页";
}
}
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 self::$max ? self::$max : $e;
}
if (self::$page > (self::$max - $f))
{
$s = self::$max - self::$number;
$s = $s
{$i}";
else
$str .= "
{$i}";
}
return $str;
}
public static function next()
{
if (self::$page
下一页";
}
}
public static function end()
{
if ((self::$max - self::$page) > 1)
{
$url = self::url(self::$max);
return "
末页";
}
}
public static function url($page)
{
return str_replace('{page}', $page, self::$url);
}
}