Component/FilterComponent.php
public function pageFromQuery()
    {
        if ($this->request) {
            $page = $this->request->query->getInt('page');
        } else {
            $page = 0;
        }

        return ($page > 0) ? $page : 1;
    }
public function pageFromQuery()
    {
        if ($this->request) {
            $page = $this->request->query->getInt('page');
        } else {
            $page = 0;
        }

        return ($page > 0) ? $page : 1;
    }
Returns the current page from the query.
If the page is not set, it will return page 1.

@return int