🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# Class **Phalcon\Paginator\Adapter\NativeArray**[](# "永久链接至标题") *extends* abstract class [*Phalcon\Paginator\Adapter*](#) *implements*[*Phalcon\Paginator\AdapterInterface*](#) Pagination using a PHP array as source of data ~~~ <?php $paginator = new \Phalcon\Paginator\Adapter\NativeArray( array( "data" => array( array('id' => 1, 'name' => 'Artichoke'), array('id' => 2, 'name' => 'Carrots'), array('id' => 3, 'name' => 'Beet'), array('id' => 4, 'name' => 'Lettuce'), array('id' => 5, 'name' => '') ), "limit" => 2, "page" => $currentPage ) ); ~~~ ### Methods[](# "永久链接至标题") public **__construct** (*unknown* $config) Phalcon\Paginator\Adapter\NativeArray constructor public **getPaginate** () Returns a slice of the resultset to show in the pagination public **setCurrentPage** (*unknown* $page) inherited from Phalcon\Paginator\Adapter Set the current page number public **setLimit** (*unknown* $limitRows) inherited from Phalcon\Paginator\Adapter Set current rows limit public **getLimit** () inherited from Phalcon\Paginator\Adapter Get current rows limit | - [索引](# "总目录") - [下一页](# "Class Phalcon\Paginator\Adapter\QueryBuilder") | - [上一页](# "Class Phalcon\Paginator\Adapter\Model") | - [API Indice](#) »