ThinkPHP版本3.2,實現一個頁面多個分頁。
修改分頁類,\ThinkPHP\Library\Think\Page.class.php。修改構造方法。如下:
原來的構造方法:
public function __construct($totalRows, $listRows, $parameter = array()) {
C('VAR_PAGE') && $this->p = C('VAR_PAGE'); //設置分頁參數名稱
.......
}
修改成如下:
public function __construct($totalRows, $listRows, $parameter = array(), $varPage = '',) {
if ($varPage) {
$this->p = $varPage;
} else {
C('VAR_PAGE') && $this->p = C('VAR_PAGE'); //設置分頁參數名稱
}
.....
}