如果 findPage 不能满足要求 试试这个
[php]
/** According to the array paging
* @param array $array
* @param int $limit
* @return array
*/
function arrayPage($array,$limit) {
$count = count($array);
if($count){
import('ORG.Util.Page');//引入分页类
$p = New Page($count,$limit);
$data['list'] = array_slice($array, $p->firstRow, $p->listRows);
$data['page'] = $p->show();
return $data;
}
}
[/php]
action 使用
[php]
$pages = arrayPage($comp,10);
//dump($pages);
$this->assign('list',$pages);
[/php]
相关文章:
-
2021-11-23
-
2022-12-23
-
2021-11-23
-
2021-11-14
-
2022-12-23
-
2022-12-23
-
2022-12-23
猜你喜欢
-
2021-11-23
-
2021-11-23
-
2021-11-23
-
2021-11-23
-
2021-11-23
-
2021-11-23
-
2021-11-23
相关资源
-
下载
2023-01-26
-
下载
2023-03-21
-
下载
2023-03-18
-
下载
2023-01-13