Using the MVC methodology, how do you get the pagination to work?
I want to use JPagination as per:
Code: Select all
jimport('joomla.html.pagination');
$pageNav = new JPagination( $total, $limitstart, $limit );
Code: Select all
$db->setQuery( $query, $pageNav->limitstart, $pageNav->limit );
Code: Select all
function _buildQuery()
{
$query = ' SELECT * FROM #__gphmgrgraphs ORDER BY graphID ASC, graphRowID ASC';
return $query;
}
function getData()
{
// Lets load the data if it doesn't already exist
if (empty( $this->_data ))
{
$query = $this->_buildQuery();
$this->_data = $this->_getList( $query );
}
return $this->_data;
}
Any ideas?
Thanks,
StuG