“Displaying X to Y of Z results” using Codeigniter pagination library?

前端 未结 3 1901
名媛妹妹
名媛妹妹 2021-01-15 05:58

I am, using the Codeigniter pagination library,

I am wondering how I can grab the number of the first and last items displayed using the pagination class?

So

3条回答
  •  Happy的楠姐
    2021-01-15 06:26

    itachi's solution works great except you need to handle the case where the last page has less than $per_page elements.

    if ($result_end > $total) {
        $result_end = $total;
    }
    

提交回复
热议问题