Contao\Pagination::__construct PHP Метод

__construct() публичный Метод

Set the number of rows, the number of results per pages and the number of links
public __construct ( integer $intRows, integer $intPerPage, integer $intNumberOfLinks = 7, string $strParameter = 'page', Template $objTemplate = null, boolean $blnForceParam = false )
$intRows integer The number of rows
$intPerPage integer The number of items per page
$intNumberOfLinks integer The number of links to generate
$strParameter string The parameter name
$objTemplate Template The template object
$blnForceParam boolean Force the URL parameter
    public function __construct($intRows, $intPerPage, $intNumberOfLinks = 7, $strParameter = 'page', Template $objTemplate = null, $blnForceParam = false)
    {
        $this->intPage = 1;
        $this->intRows = (int) $intRows;
        $this->intRowsPerPage = (int) $intPerPage;
        $this->intNumberOfLinks = (int) $intNumberOfLinks;
        // Initialize default labels
        $this->lblFirst = $GLOBALS['TL_LANG']['MSC']['first'];
        $this->lblPrevious = $GLOBALS['TL_LANG']['MSC']['previous'];
        $this->lblNext = $GLOBALS['TL_LANG']['MSC']['next'];
        $this->lblLast = $GLOBALS['TL_LANG']['MSC']['last'];
        $this->lblTotal = $GLOBALS['TL_LANG']['MSC']['totalPages'];
        if (\Input::get($strParameter) > 0) {
            $this->intPage = \Input::get($strParameter);
        }
        $this->strParameter = $strParameter;
        if ($objTemplate === null) {
            /** @var FrontendTemplate|object $objTemplate */
            $objTemplate = new \FrontendTemplate('pagination');
        }
        $this->objTemplate = $objTemplate;
        $this->blnForceParam = $blnForceParam;
    }

Usage Example

 public function __construct($intRandomSeed, $intRows, $intPerPage, $intNumberOfLinks = 7, $strParameter = 'page', \Template $objTemplate = null, $blnForceParam = false)
 {
     $this->intRandomSeed = $intRandomSeed;
     parent::__construct($intRows, $intPerPage, $intNumberOfLinks, $strParameter, $objTemplate, $blnForceParam);
 }