Do not override this function.

@return Page
10631
public function showLoginForm()
    {
        $this->app->template->trySet('page_title', 'Login');
        if ($this->app->layout && $this->login_layout_class) {
            $this->app->layout->destroy();
            $this->app->add($this->login_layout_class);
            /** @type Page $p */
            $p = $this->app->layout->add('Page', null, null, array('page/login'));
        } else {
            /** @type Page $p */
            $p = $this->app->add('Page', null, null, array('page/login'));
        }
        $this->app->page_object = $p;

        // hook: createForm use this to build basic login form
        $this->form = $this->hook('createForm', array($p))[0];

        // If no hook, build standard form
        if (!is_object($this->form)) {
            $this->form = $this->createForm($p);
        }

        $this->hook('updateForm');
        $f = $this->form;
        if ($f->isSubmitted()) {
            $id = $this->verifyCredentials($f->get('username'), $f->get('password'));
            if ($id) {
                $this->loginByID($id);
                $this->loggedIn($f->get('username'), $f->get('password'));
                exit;
            }
            $f->getElement('password')->displayFieldError('Incorrect login information');
        }

        return $p;
    }
789420
public function getPages()
	{
		return $this->total > $this->limit ? ceil($this->total / $this->limit) : 1;
	}
1256464
public function page($pageSize = 10, $currentPage = 0)
    {
        if ($pageSize === static::$pageAll) {
            return $this;
        }
        /* normalize $currentPage and $currentPage */
        if (!is_numeric($currentPage) || $currentPage < 0) {
            $currentPage = 0;
        }
        $currentPage = (int) $currentPage;
        if (!is_numeric($pageSize) || $pageSize < 1) {
            $pageSize = static::$defaultPageSize;
        }
        $pageSize = (int) $pageSize;
        return $this->limit($pageSize)->offset($pageSize * $currentPage);
    }
948376
public function setPage($page)
    {
        if (empty($page)) {
            return $this->clearPage();
        }

        session()->put($this->getSessionKey(static::TYPE_PAGE), $page);

        return $this;
    }
909229
public function page($page = null) {
        if ($page === null) {
            return $this->page;
        }

        $this->page = (int) $page;

        return $this;
    }
151091
public function setPage($page)
  {
    if ($this->isLocked()) {
      return $this->getObj()->setPage($page)->setLocked();
    } else {
      return parent::setPage($page);
    }
  }
1218095
public function getPage(){
		if(isset($this->page)){
			return $this->page;
			}
		if($this->type==PTYPE_GET){
			return BRequest::getInt('page');
			}
		
		}
707826
public function reset()
    {
        $this->filters = array();
        $this->limit = null;
        $this->order = null;
        $this->page = null;

        return $this;
    }
393663
public function set(): PageInterface
    {
        $hook = $this->isNetwork() ? 'network_admin_menu' : 'admin_menu';

        // Action for page display.
        $this->action->add($hook, [$this, 'build']);
        // Action for page settings.
        $this->action->add('admin_init', [$this, 'configureSettings']);

        return $this;
    }
929565
public function getPseudoPage()
    {
        $page = $this;
        while ($page && !$page->isPseudoPage) {
            $page = $page->parent;
        }
        return $page;
    }
413123
public function getPage()
    {
        if (empty($this->page) && ($paramName = $this->getParamName()) != '') {
            $this->setPage(\pwf\basic\Application::$instance->getRequest()->get($paramName));
        }

        return $this->page;
    }
455532
public function get_page() {

        // unless page was not specifically set through the "set_page" method
        if (!$this->_properties['page_set']) {

            // if
            if (

                // page propagation is SEO friendly
                $this->_properties['method'] == 'url' &&

                // the current page is set in the URL
                preg_match('/\b' . preg_quote($this->_properties['variable_name']) . '([0-9]+)\b/i', $_SERVER['REQUEST_URI'], $matches) > 0

            )

                // set the current page to whatever it is indicated in the URL
                $this->set_page((int)$matches[1]);

            // if page propagation is done through GET and the current page is set in $_GET
            elseif (isset($_GET[$this->_properties['variable_name']]))

                // set the current page to whatever it was set to
                $this->set_page((int)$_GET[$this->_properties['variable_name']]);

        }

        // if showing records in reverse order we must know the total number of records and the number of records per page
        // *before* calling the "get_page" method
        if ($this->_properties['reverse'] && $this->_properties['records'] == '') trigger_error('When showing records in reverse order you must specify the total number of records (by calling the "records" method) *before* the first use of the "get_page" method!', E_USER_ERROR);

        if ($this->_properties['reverse'] && $this->_properties['records_per_page'] == '') trigger_error('When showing records in reverse order you must specify the number of records per page (by calling the "records_per_page" method) *before* the first use of the "get_page" method!', E_USER_ERROR);

        // get the total number of pages
        $this->_properties['total_pages'] = $this->get_pages();

        // if there are any pages
        if ($this->_properties['total_pages'] > 0) {

            // if current page is beyond the total number pages
            /// make the current page be the last page
            if ($this->_properties['page'] > $this->_properties['total_pages']) $this->_properties['page'] = $this->_properties['total_pages'];

            // if current page is smaller than 1
            // make the current page 1
            elseif ($this->_properties['page'] < 1) $this->_properties['page'] = 1;

        }

        // if we're just starting and we have to display links in reverse order
        // set the first to the last one rather then first
        if (!$this->_properties['page_set'] && $this->_properties['reverse']) $this->set_page($this->_properties['total_pages']);

        // return the current page
        return $this->_properties['page'];

    }
609015
protected function getDefaultPerPage()
    {
        if (is_numeric($this->perPage) && $this->perPage > 0) {
            return $this->perPage;
        }

        return config('repository.perPage', $this->makeModel(false)->getPerPage());
    }
546237
public function getPage() {
    $page = $this->traverse($this->pageMap, Server::getRequestUriParts());
    if ($page === null) {
      return null;
    }
    return $this->createWebPageFromClassName($page);
  }
198916
public function getPages()
    {
        $pages = new Page();
        $userPages = new UserPage();
        $sql = "SELECT * FROM " . $userPages->getTableName() . " as up
        LEFT JOIN {$pages->getTableName()} as p ON up.id_page = p.id
        WHERE up.id_user = " . $this->id;

        return $this->db->select($sql);
    }
888415
public function paginate()
    {
        $model = $this->model;

        if (property_exists($model, 'order')) {
            $paginator = $model::orderBy($model::$order, $model::$sort)->paginate($model::$paginate, $model::$index);
        } else {
            $paginator = $model::paginate($model::$paginate, $model::$index);
        }

        if (!$this->isPageInRange($paginator) && !$this->isFirstPage($paginator)) {
            throw new NotFoundHttpException();
        }

        if (count($paginator)) {
            $this->paginateLinks = $paginator->render();
        }

        return $paginator;
    }
509449
protected function getNextPage()
	{
		$backtrace = debug_backtrace();
		return $this->getNextPageFromList(Utils::getReturnTypes($backtrace[1]['class'], $backtrace[1]['function']), $backtrace[1]['class']);
	}