Get the number of the current page.

@return int
504365
public function getCurrentPage()
	{
		$page = (int) $this->currentPage ?: $this->request->query->get($this->pageName, 1);

		if ($page < 1 || filter_var($page, FILTER_VALIDATE_INT) === false)
		{
			return 1;
		}

		return $page;
	}
232108
protected function get_lastpage() {
        $pages = $this->load_all_pages();
        if (count($pages) > 0) {
            foreach ($pages as $page) {
                if ((int)$page->nextpageid === 0) {
                    return $page;
                }
            }
        }
        return false;
    }
1344459
public function getCurrentPageInfo()
    {
        $result = array(
            'handle' => $this->getCurrentPage()
        );
        
        if (Mage::registry('current_category') instanceof Mage_Catalog_Model_Category) {
            $result['category'] = Mage::registry('current_category')->getId();
        }

        if (Mage::registry('current_product') instanceof Mage_Catalog_Model_Product) {
            $result['product'] = Mage::registry('current_product')->getId();
        }
        
        return $result;
    }
340255
public function getPages()
    {
        $numAdjacents = (int) floor(($this->maxPages - 3) / 2);

        if ($this->currentPage + $numAdjacents > $this->numPages) {
            $begin = $this->numPages - $this->maxPages + 2;
        } else {
            $begin = $this->currentPage - $numAdjacents;
        }
        if ($begin < 2) {
            $begin = 2;
        }

        $end = $begin + $this->maxPages - 2;
//        if ($end >= $this->numPages) $end = $this->numPages - 1;

//        $tmpBegin = $this->maxPages - floor($this->maxPages / 2);
//        $tmpEnd = $tmpBegin + $this->maxPages - 1;
//
//        if ($tmpBegin < 1) {
//            $tmpEnd += 1 - $tmpBegin;
//            $tmpBegin = 1;
//        }
//
//        if ($tmpEnd > $this->getLastPage()) {
//            $tmpBegin -= $tmpEnd - $this->getLastPage();
//            $tmpEnd = $this->getLastPage();
//        }
//
//        $begin = min($tmpBegin, 2);
//        $end = $tmpEnd;

        return range($begin, $end, 1);
    }
1107879
public function getTotalPage()
    {
        $this->pageSize > 0 || $this->pageSize = 10;

        $totalPage = ceil($this->total / $this->pageSize);

        $totalPage >= 1 || $totalPage = 1;

        return $totalPage;
    }
509054
protected function getCurrentPageNumber($query)
    {
        $currentPageNumber = $this->currentPageNumber;

        if (!$currentPageNumber && empty($this->searchTerm)) {
            // Restore the last visited page from the session if available.
            $currentPageNumber = $this->getSession('lastVisitedPage');
        }

        $currentPageNumber = intval($currentPageNumber);

        if ($currentPageNumber > 1) {
            $count = $query->count();

            // If the current page number is higher than the amount of available pages, go to the last available page
            if ($count <= (($currentPageNumber - 1) * $this->recordsPerPage)) {
                $currentPageNumber = ceil($count / $this->recordsPerPage);
            }
        }

        return $currentPageNumber;
    }
1043574
public function get_pagenum()
    {
        $pagenum = isset($_REQUEST['paged']) ? absint($_REQUEST['paged']) : 0;

        if (isset($this->pagination_args['total_pages']) && $pagenum > $this->pagination_args['total_pages']) {
            $pagenum = $this->pagination_args['total_pages'];
        }

        return max(1, $pagenum);
    }
453000
public function count(): int
    {
        // If the count is already set, return it
        if(!is_null($this->count)) {
            return $this->count;
        }

        // Maually create a count by looping through the entities. This will
        // trigger the pagination calls to get the correct count of entities
        $count = 0;
        foreach($this as $entity) {
            $count++;
        }

        $this->count = $count;
        return $count;
    }
699358
public function totalPages()
    {
        $total = $this->totalObjects();
        $perPage = $this->objectsPerPage();

        return (int) ceil($total / $perPage);
    }
847415
function current()
    {
        if (!isset($this->_curPage)
            || $this->_curPage->getPage() != $this->_position
        ) {
            $this->_curPage = $this->_pages->get($this->_position);
        }
        return $this->_curPage;
    }
12915
public function getLastPageNumber()
    {
        $this->loadData();
        $count = count($this->filteredData);

        return ceil($count / $this->pageSize);
    }
887568
protected function getMinPage()
    {
        $minPageNumber = null;
        $minPage       = null;
        foreach ($this->pages as $page) {
            $pageNumber = $page->getPageNumber();
            if ($minPageNumber === null || $pageNumber < $minPageNumber) {
                $minPageNumber = $pageNumber;
                $minPage       = $page;
            }
        }
        return $minPage;
    }
85568
public function getPage() {
		
		$cookieName = Application::getCookiePrefix() . ucfirst($this->module) . ucfirst($this->action);
		
		if (!is_null($this->page)) {
			
			return ((int)$this->page > 1 ? $this->page : 1);
			
		} else if (isset($_COOKIE[$cookieName]) and (int)$_COOKIE[$cookieName] > 0) {
			
			return (int)$_COOKIE[$cookieName];
			
		} else {
			
			return 1;
			
		}
		
	}
135935
public function currentPage()
    {
        $currentRoute = $this->router->getCurrentRoute();

        if (! $currentRoute) {
            return 1;
        }

        $query = $currentRoute->parameter('pageQuery');

        return (int) str_replace($this->pageKeyword.'/', '', $query) ?: 1;
    }
702105
public function getCurrentPage()
    {
        $page = $this->getRequest()->query->getInt($this->getActionQueryParameter(static::QUERY_PARAMETER_PAGE), 1);
        if ($page < 1) {
            $page = 1;
        }
        return $page;
    }
1286109
public function getPageCount()
    {
        if ($this->pageCount === null) {
            $catalog = $this->parser->getCatalog();

            $pages = PdfType::resolve(PdfDictionary::get($catalog, 'Pages'), $this->parser);
            $count = PdfType::resolve(PdfDictionary::get($pages, 'Count'), $this->parser);

            $this->pageCount = PdfNumeric::ensure($count)->value;
        }

        return $this->pageCount;
    }
438337
public static function currentPage() {
		$uri = static::to(static::detectPath());
		foreach ($_GET as $k => $v) {
			$uri->param($k, $v);
		}

		return $uri;
	}