API15

API15:JModelList/getPagination

From Joomla! Documentation

Revision as of 21:52, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to get a JPagination object for the data set. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JModelList/getPagination|Edit ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Method to get a JPagination object for the data set.

[Edit Descripton]

Template:Description:JModelList/getPagination

Syntax

getPagination()


Returns

object A JPagination object for the data set.

Defined in

libraries/joomla/application/component/modellist.php

Importing

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

Source Body

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');
        $page = new JPagination($this->getTotal(), (int) $this->getState('list.start'), (int) $this->getState('list.limit'));

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

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

[Edit See Also] Template:SeeAlso:JModelList/getPagination

Examples

<CodeExamplesForm />