The generate function calls the `__build()` function before appending
all the current page's headers and then finally calling the `$Html's`
generate function which generates a HTML DOM from all the
XMLElement children.

@param null $page
@return string
19381
public function generate($page = null)
    {
        $this->__build();
        parent::generate($page);
        return $this->Html->generate(true);
    }
393452
public function current($page = null)
    {
        if ($page === null) {
            return $this->options['page'];
        } else {
            $this->options['page'] = $page;
            return $this;
        }
    }
605849
public function url( $page )
	{
		if ( $page <= 0 )
			$page = 1;

		// If we have any extra query string key / value pairs that need to be added
		// onto the URL, we will put them in query string form and then attach it
		// to the URL. This allows for extra information like sortings storage.
		$parameters = [$this->pageName => $page];

		if ( count( $this->query ) > 0 )
			$parameters = array_merge( $this->query, $parameters );

		return $this->path . ( Str::contains( $this->path, '?' ) ? '&' : '?' ) . http_build_query( $parameters, '', '&' ) . $this->buildFragment();
	}
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), '?');
    }
546237
public function getPage() {
    $page = $this->traverse($this->pageMap, Server::getRequestUriParts());
    if ($page === null) {
      return null;
    }
    return $this->createWebPageFromClassName($page);
  }
266831
private function buildChieldString($page, $url, $pageName, $fragments, $i)
    {
        settype($page, 'string');

        $add = $this->buildAddUrl($url);
        $string = $url . $add . $i . $fragments;
        return sprintf("<li><a href='%s' class='%s'>%s</a></li>", $string, $pageName, $page);
    }
1222909
public function getAll($page = null)
    {
        $page = !empty($page) ? "page={$page}" : '';
        $request = $this->paystackHttpClient->get(
            $this->transformUrl(Resource::CUSTOMERS_URL, '').$page
        );

        return $this->processResourceRequestResponse($request);
    }
70374
protected function buildLink($page)
    {
        if ($page == 1 && $this->config->getFirstPageLink()) {
            return $this->config->getFirstPageLink();
        }

        if (is_callable($this->config->getPageLink())) {
            return call_user_func($this->config->getPageLink(), $page);
        } else {
            return sprintf($this->config->getPageLink(), $page);
        }
    }
556596
public function page($page = null)
    {
        if (isset($page)) {
            $this->setPage($page);

            return $this;
        }

        return $this->getPage();
    }
501991
public function render($html = null) {
		$control = $this->getPaginator()->getPaginationControl();
		
		// First
		if ($this->_useFirstLast && isset($control[PaginatorInterface::CONTROL_FIRST])) {
			$this->addElement(
				$this->_renderUrl($control[PaginatorInterface::CONTROL_FIRST]),
				$this->_stringFirst,
				'page-first'
			);
		}
		
		// Previous
		if ($this->_usePrevNext && isset($control[PaginatorInterface::CONTROL_PREVIOUS])) {
			$this->addElement(
				$this->_renderUrl($control[PaginatorInterface::CONTROL_PREVIOUS]),
				$this->_stringPrev,
				'page-previous'
			);
		}
		
		// Range
		if ($this->_useRange && isset($control[PaginatorInterface::CONTROL_RANGE])) {
			foreach ($control[PaginatorInterface::CONTROL_RANGE] as $element) {
				$this->addElement($this->_renderUrl($element), $element, 'page-' . $element);
			}
		}
		
		// Next
		if ($this->_usePrevNext && isset($control[PaginatorInterface::CONTROL_NEXT])) {
			$this->addElement(
				$this->_renderUrl($control[PaginatorInterface::CONTROL_NEXT]),
				$this->_stringNext,
				'page-next'
			);
		}
		
		// Last
		if ($this->_useFirstLast && isset($control[PaginatorInterface::CONTROL_LAST])) {
			$this->addElement(
				$this->_renderUrl($control[PaginatorInterface::CONTROL_LAST]),
				$this->_stringLast,
				'page-last'
			);
		}
		
		if (isset($control[PaginatorInterface::CONTROL_CURRENT])) {
			$this->setActive('page-' . $control[PaginatorInterface::CONTROL_CURRENT]);
		}
		
		return parent::render();
	}
407767
public function generateHTML() {
        //create blocktrail pub key QR codes if not already done
        if (!$this->blocktrailPubKeyQRs) {
            $this->processBlocktrailPubKeys();
        }
        $pubKeysHtml = "";
        foreach ($this->blocktrailPubKeyQRs as $pubKey) {
            $pubKeysHtml .= "<img src='{$pubKey['qr']}' />";
        }
        $totalPubKeys = count($this->blocktrailPubKeyQRs);

        $backupInfo = $this->prepareBackupInfo();
        $extraInfo = $this->prepareExtraInfo();

        $passwordEncryptedSecret = null;
        if (isset($this->backupInfo['encrypted_secret'])) {
            $passwordEncryptedSecret = $this->backupInfo['encrypted_secret'];
        }

        $html = self::renderTemplate(__DIR__ . "/../resources/templates/recovery_sheet.html.php", [
            'identifier' => $this->identifier,
            'totalPubKeys' => $totalPubKeys,
            'pubKeysHtml' => $pubKeysHtml,
            'backupInfo' => $backupInfo,
            'extraInfo' => $extraInfo,
            'passwordEncryptedSecret' => $passwordEncryptedSecret,
            'options' => $this->options,
        ]);

        return $html;
    }
688775
private function generateAddUrl(array $page): string
    {
        $event = new GenerateFrontendUrlEvent($page, null, $page['language']);

        $this->dispatcher->dispatch(ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL, $event);

        $url = UrlBuilder::fromUrl($event->getUrl() . '?')
            ->setQueryParameter('act', 'create');

        return $url->getUrl();
    }
888360
public function index($page = null)
    {
        $url = sprintf('buckets/%d/webhooks.json', $this->bucket);

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

        return $this->indexResponse($webhooks, Webhook::class)->map(function ($webhook) {
            $webhook->inContext($this->bucket);
            return $webhook;
        });
    }
462476
public function andParentIs(Page $page = null)
    {
        if (null === $page) {
            // Looking for root
            return $this->andWhere($this->getSectionAlias() . '._parent IS NULL')
                            ->andWhere($this->getSectionAlias() . ' = ' . $this->getAlias());
        }

        if (false === $page->hasMainSection()) {
            // Page is leaf, no child
            return $this->andWhere('1 = 0');
        }

        $suffix = $this->getSuffix();
        $qOr = $this->expr()->orX();
        $qOr->add($this->getSectionAlias().'._parent = :parent'.$suffix)
                ->add($this->getAlias().'._section = :parent'.$suffix);

        return $this->andWhere($qOr)
                        ->andWhere($this->getAlias().'._level = :level'.$suffix)
                        ->setParameter('parent'.$suffix, $page->getSection())
                        ->setParameter('level'.$suffix, $page->getLevel() + 1);
    }
1030458
private function get_link_html($page)
    {
        global $post;

        if (! empty($post) && $page->ID == $post->ID) {
            $li_class = $this->args['li_active_class'] . ' ' . $this->args['li_class'];
            $link_class = $this->args['link_active_class'] . ' ' . $this->args['link_class'];
        } else {
            $li_class = $this->args['li_class'];
            $link_class = $this->args['link_class'];
        }

        return \sprintf(
            '<li class="%s">%s<a class="%s" href="%s">%s%s%s</a>%s</li>',
            $li_class,
            $this->args['before_link'],
            $link_class,
            get_the_permalink($page),
            $this->args['before_text'],
            get_the_title($page),
            $this->args['after_text'],
            $this->args['after_link']
        );
    }
856449
public function render($html = null) {
		$link = $this->getAnchor()->render();
		
		if ($html !== null) {
			$link .= $this->getSeparator();
			$link .= $html;
		}
		
		return parent::render($link);
	}
1062520
public function render($html = null) {
		$separator = $this->getSeparator();
		$result    = '';
		
		foreach ($this->getElements() as $element) {
			$result .= $separator . $element->render();
		}
		
		return parent::render($result . $separator);
	}