API16

JModelList/getPagination

From Joomla! Documentation

< API16:JModelList
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Method to get a JPagination object for the data set.



Syntax[edit]

getPagination()


Returns[edit]

object A object for the data set.

Defined in[edit]

libraries/joomla/application/component/modellist.php

Importing[edit]

jimport( 'joomla.application.component.modellist' );

Source Body[edit]

public function getPagination()
{
        // Get a storage key.
        $store = $this->_getStoreId('getPagination');

        // Try to load the data from internal storage.
        if (!empty($this->_cache[$store])) {
                return $this->_cache[$store];
        }

        // Create the pagination object.
        jimport('joomla.html.pagination');
        $limit = (int) $this->getState('list.limit') - (int) $this->getState('list.links');
        $page = new JPagination($this->getTotal(), (int) $this->getState('list.start'), $limit);

        // Add the object to the internal cache.
        $this->_cache[$store] = $page;

        return $this->_cache[$store];
}



Examples[edit]

Code Examples[edit]