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 $startwrap, \$endwrap $endwrap, \$itemwrap $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

\$startwrap

Wrap for the list start

$endwrap

\$endwrap

Wrap for the list end

$itemwrap

\$itemwrap

Wrap for a single item

Field converting facility.

convert(\$field $field, \$value $value) 

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

Parameters

$field

\$field

Field index

$value

\$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 $return) 

Parameters

$return

\$return

If true, returns the list

Sets data.

setData(\$index $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

\$index

Numeric index

Sets the starting page number.

setListStart(\$startpage $startpage) 

Parameters

$startpage

\$startpage

Page number on which the list display starts

Sets the number of records per page.

setResultsPerPage(\$numresults $numresults) 

Parameters

$numresults

\$numresults

Amount of records per page

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

sort(\$field $field, \$order $order) 

Parameters

$field

\$field

Field index

$order

\$order

Sort order (see php's sort documentation)

 Properties

 

Data container

$data : array

 

Wrap for table end

$endwrap : string

 

Wrap for a single item

$itemwrap : string

 

Start page

$listStart : string

 

Number of records displayed per page

$resultsPerPage : string

 

Wrap for table start

$startwrap : string