Build an URL which this view can use for js call-backs. It should
be guaranteed that requesting returned URL would at some point call
$this->init().

@param array $page

@return string
505675
public function jsURL($page = [])
    {
        return $this->app->jsURL($page, false, array_merge($this->_getStickyArgs($this->name), $this->stickyArgs));
    }
909229
public function page($page = null) {
        if ($page === null) {
            return $this->page;
        }

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

        return $this;
    }
70275
public function index($page = null)
    {
        $url = sprintf('buckets/%d/vaults/%d/uploads.json', $this->bucket, $this->parent);

        $uploads = $this->client->get($url, [
            'query' => [
                'page' => $page,
            ],
        ]);

        return $this->response($uploads, Upload::class);
    }
1253377
public static function pageGetArray(?string $page = null): array
    {
        if ($page === null) {
            $page = $_SERVER['PHP_SELF'];
        }
        return self::getArray($page);
    }
785722
public function iAmOnThePage($page)
    {
        $url = $this->generateUrl($this->routeMap[$page]);
        $this->getSession()->visit($url);
    }
174274
public function getText(Page $page = null)
    {
        if ($contents = $this->get('Contents')) {

            if ($contents instanceof ElementMissing) {
                return '';
			} elseif ($contents instanceof ElementNull) {
				return '';
            } elseif ($contents instanceof PDFObject) {
                $elements = $contents->getHeader()->getElements();

                if (is_numeric(key($elements))) {
                    $new_content = '';

                    foreach ($elements as $element) {
                        if ($element instanceof ElementXRef) {
                            $new_content .= $element->getObject()->getContent();
                        } else {
                            $new_content .= $element->getContent();
                        }
                    }

                    $header   = new Header(array(), $this->document);
                    $contents = new PDFObject($this->document, $header, $new_content);
                }
            } elseif ($contents instanceof ElementArray) {
                // Create a virtual global content.
                $new_content = '';

                foreach ($contents->getContent() as $content) {
                    $new_content .= $content->getContent() . "\n";
                }

                $header   = new Header(array(), $this->document);
                $contents = new PDFObject($this->document, $header, $new_content);
            }

            return $contents->getText($this);
        }

        return '';
    }
533243
public function getRelativeUrl($page, Request $request)
    {
        return $this->router->generate(
            $request->attributes->get('_route'),
            array_merge($this->getParametersFromRequest($request), array('page' => $page))
        );
    }
544428
public function createUri($page)
    {
        $queryString   = $this->query;
        $queryString[] = "page={$page}";
        $queryString   = implode('&', $queryString);

        return Request::pathInfo() . "?{$queryString}";
    }
459869
public function opened(Page $page)
	{
		return $this->pageUrlMatcherRegistry->match($this->_session->getCurrentUrl(), $page);
	}
1072811
public function index($page = null)
    {
        $url = sprintf('buckets/%d/questions/%d/answers.json', $this->bucket, $this->parent);

        $answers = $this->client->get($url, [
            'query' => [
                'page' => $page,
            ],
        ]);

        return $this->indexResponse($answers, QuestionAnswer::class);
    }
1051329
protected function generateUrl(int $page): string
    {
        $routeGenerator = $this->routeGenerator;

        // We use trim here because Pagerfanta (or Symfony?) adds an extra '?'
        // at the end of page when there are no other query params
        return trim($routeGenerator($page), '?');
    }
727433
private function getPagination($page)
    {
        $limit = 5;
        if ($page !== null) {
            if ($page === 'all') {
                $limit = null;
                $page = null;
            } else {
                $page = (int) $page;
            }
        } else {
            $page = 1;
        }

        return ['page' => $page, 'limit' => $limit];
    }
93877
public function getPageUrl($page, $uriType = Router::ABSOLUTE_PATH)
    {
        if ($page > $this->getPagesCount()) {
            throw new \BadMethodCallException('The page requested does not exist');
        }

        if ( ! ($this->getPath())) {
            throw new \Exception('The path is empty, either set it with a parse request or with a getter method');
        }

        $queryParams = $this->getQuery();
        $queryParams['page'] = $page;

        return $this->router
            ->generate($this->getPath(), $queryParams, $uriType);
    }
409107
public function Index($Page = '') {
		$this->AddJsFile('search.js');
		$this->Title(T('Search'));
      
      SaveToConfig('Garden.Format.EmbedSize', '160x90', FALSE);
      Gdn_Theme::Section('SearchResults');
      
      list($Offset, $Limit) = OffsetLimit($Page, C('Garden.Search.PerPage', 20));
      $this->SetData('_Limit', $Limit);
		
		$Search = $this->Form->GetFormValue('Search');
      $Mode = $this->Form->GetFormValue('Mode');
      if ($Mode)
         $this->SearchModel->ForceSearchMode = $Mode;
      try {
         $ResultSet = $this->SearchModel->Search($Search, $Offset, $Limit);
      } catch (Gdn_UserException $Ex) {
         $this->Form->AddError($Ex);
         $ResultSet = array();
      } catch (Exception $Ex) {
         LogException($Ex);
         $this->Form->AddError($Ex);
         $ResultSet = array();
      }
      Gdn::UserModel()->JoinUsers($ResultSet, array('UserID'));
      
      // Fix up the summaries.
      $SearchTerms = explode(' ', Gdn_Format::Text($Search));
      foreach ($ResultSet as &$Row) {
         $Row['Summary'] = SearchExcerpt(Gdn_Format::PlainText($Row['Summary'], $Row['Format']), $SearchTerms);
         $Row['Format'] = 'Html';
      }
      
		$this->SetData('SearchResults', $ResultSet, TRUE);
		$this->SetData('SearchTerm', Gdn_Format::Text($Search), TRUE);
		if($ResultSet)
			$NumResults = count($ResultSet);
		else
			$NumResults = 0;
		if ($NumResults == $Offset + $Limit)
			$NumResults++;
		
		// Build a pager
		$PagerFactory = new Gdn_PagerFactory();
		$this->Pager = $PagerFactory->GetPager('MorePager', $this);
		$this->Pager->MoreCode = 'More Results';
		$this->Pager->LessCode = 'Previous Results';
		$this->Pager->ClientID = 'Pager';
		$this->Pager->Configure(
			$Offset,
			$Limit,
			$NumResults,
			'dashboard/search/%1$s/%2$s/?Search='.Gdn_Format::Url($Search)
		);
		
//		if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {
//         $this->SetJson('LessRow', $this->Pager->ToString('less'));
//         $this->SetJson('MoreRow', $this->Pager->ToString('more'));
//         $this->View = 'results';
//      }
		
      $this->CanonicalUrl(Url('search', TRUE));

		$this->Render();
	}
127
public function link($page, $args = array())
    {
        $this->setElement('a');
        $this->setAttr('href', $this->app->url($page, $args));

        return $this;
    }
1230422
protected function preparePage(array &$page)
    {
        $user = $this->user->get($page['user_id']);

        $this->setItemAlias($page, 'page', $this->alias);
        $this->setItemImages($page, 'page', $this->image);
        $this->setItemTranslation($page, 'page', $this->translation_entity);

        if (!empty($page['images'])) {
            foreach ($page['images'] as &$file) {
                $this->setItemTranslation($file, 'file', $this->translation_entity);
            }
        }

        $page['author'] = isset($user['email']) ? $user['email'] : $this->text('Unknown');
    }
556596
public function page($page = null)
    {
        if (isset($page)) {
            $this->setPage($page);

            return $this;
        }

        return $this->getPage();
    }