Overview  Package  Tree cmsdAm 0.8

cmsdAm

Class cmsdam_paginator

cmsdAm.cmsdam_paginator

class cmsdam_paginator

Each CMS offers the user the ability to split an array in more pieces in a paging fashion.

This is useful, for example, if you have to render the result of the search engine, or another array of your choice, to the page. Obviously, the output may become (very) long. This is not professional, so the output very often is divided in pages. This class do that.

Class instance: $cms->paginator

Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>

Field Summary
Method Summary
public arraypaginator_array

This method takes the array "$array" and splits it into n page arrays of "$maxrows" element max.

public intpaginator_pages

This method takes the array "$array" and calculates the number of pages for "$maxrows" elements per page.

Method Detail

paginator_array()

public array paginator_array(int maxrows,
                             int page,
                             array array)

This method takes the array "$array" and splits it into n page arrays of "$maxrows" element max.

Returns a piece of array "$array", using "$maxrows" as a number of rows (or columns) per page. "$page" is the page number to start with.

Parameters:
maxrows - The max number of rows per page
page - The page you want the array of
array - The array you want to split
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
The "$page"th page of array "$array", where each page is made of "$maxrows" rows

paginator_pages()

public int paginator_pages(int maxrows,
                           array array)

This method takes the array "$array" and calculates the number of pages for "$maxrows" elements per page.

Parameters:
maxrows - The max number of rows per page
array - The array you want the number of pages
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
The number of pages of array "$array", where each page is made of "$maxrows" rows

Overview  Package  Tree cmsdAm 0.8