We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33143eb commit a37e375Copy full SHA for a37e375
src/Builder.php
@@ -582,16 +582,19 @@ public function loadDefaultValues($entity = null)
582
583
/**
584
* 分页获取数据
585
- *
586
- * @param int $pageSize 每页数据条数
+ * @param null $pageSize 每页数据条数
+ * @param null $currentPage 当前页码,如果不指定,将自动从`$_GET['page']`获取
587
* @return DataProvider
588
*/
589
- public function paginate($pageSize = null)
+ public function paginate($pageSize = null, $currentPage = null)
590
{
591
$pageConfig = array();
592
if ($pageSize !== null) {
593
$pageConfig['pageSize'] = $pageSize;
594
}
595
+ if ($currentPage !== null) {
596
+ $pageConfig['currentPage'] = $currentPage;
597
+ }
598
return new DataProvider($this, $pageConfig);
599
600
0 commit comments