改进分页类

This commit is contained in:
thinkphp
2017-09-12 15:04:40 +08:00
parent 5a74ffca25
commit 568864e008

View File

@@ -141,7 +141,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J
*/ */
public static function getCurrentPage($varPage = 'page', $default = 1) public static function getCurrentPage($varPage = 'page', $default = 1)
{ {
$page = (int) Request::instance()->request($varPage); $page = (int) Request::instance()->param($varPage);
if (filter_var($page, FILTER_VALIDATE_INT) !== false && $page >= 1) { if (filter_var($page, FILTER_VALIDATE_INT) !== false && $page >= 1) {
return $page; return $page;