Class FrontendList Class for scrollable frontend lists

author Timo A. Hummel <Timo.Hummel@4fb.de>
version 0.1

 Methods

Creates a new FrontendList object.

FrontendList($startwrap, $endwrap, $itemwrap) 

The placeholder for item wraps are the same as for sprintf. See the documentation for sprintf.

Caution: Make sure that percentage signs are written as %%.

Parameters

$startwrap

Wrap for the list start

$endwrap

Wrap for the list end

$itemwrap

Wrap for a single item

Field converting facility.

convert($field, $value) 

Needs to be overridden in the child class to work properbly.

Parameters

$field

Field index

$value

Field value

Returns the current page.

getCurrentPage() 
returns Current page number

Returns the amount of pages.

getNumPages() 
returns Amount of pages

Outputs or optionally returns

output($return) 

Parameters

$return

If true, returns the list

Sets data.

setData($index) 

Note: This function eats as many parameters as you specify.

Example: $obj->setData(0, "foo", "bar");

Make sure that the amount of parameters stays the same for all setData calls in a single object.

Parameters

$index

Numeric index

Sets the starting page number.

setListStart($startpage) 

Parameters

$startpage

Page number on which the list display starts

Sets the number of records per page.

setResultsPerPage($numresults) 

Parameters

$numresults

Amount of records per page

Sorts the list by a given field and a given order.

sort($field, $order) 

Parameters

$field

Field index

$order

Sort order (see php's sort documentation)

 Properties

 

$data : array
 

$endwrap : string
 

$itemwrap : string
 

$listStart : string
 

$resultsPerPage : string
 

$startwrap : string