Skip to main content
Version: Fegg 5.x (next)

Model::listMax

Set ListMax Parameter

Description​

public self Model::listMax( [ int $listMax = 10 ] )

Sets the number of rows per page of find. Without it, find() returns 10 rows. A value under 1 is treated as 1. Only find() uses it: use limit with all instead of a large listMax() to get every row.

Arguments​

NameData typeDefaultRemarks
$listMaxint10Rows per page

Example​

Controller
$model = new Model(false, array(
'table' => 'cms_news',
'id' => 'news_id',
'visible' => 'visible',
));

// First page, 5 rows
$records = $model->listMax(5)->find();