/** * Constructor * * @param integer $iTotalPages * @param integer $iCurrentPage * @param string $sPageName Default 'p' * @param array $aOptions Optional options. */ public function __construct($iTotalPages, $iCurrentPage, $sPageName = 'p', array $aOptions = array()) { // Set the total number of page $this->_iTotalPages = $iTotalPages; // Retrieve the number of the current page $this->_iCurrentPage = $iCurrentPage; // Put options update $this->_aOptions += $aOptions; // It retrieves the address of the page $this->_sPageName = Page::cleanDynamicUrl($sPageName); // Management pages to see $this->_iShowItems = $this->_aOptions['range'] * 2 + 1; // It generates the paging $this->_generate(); }