Render $page into html.

This method is generally called via double-dispatch, as provided by Visitor\VisitableTrait.

@param PageInterface $page
@return string
15736
public function visitPage(PageInterface $page)
    {
        $template = 'page/' . $page->getType() . '.twig';

        return $this
            ->loadTemplate($template)
            ->render(
                [
                    "id" => $page->getId(),
                    "classes" => $page->getClasses(),
                    "data" => $page->getData(),
                    "title" => $page->getTitle(),
                    "baseHref" => $page->getBaseHref(),
                    "writables" => $page->getWritables(),
                    "projectCSS" => Settings::getInstance()->getProjectCSS(),
                    "projectJS" => Settings::getInstance()->getProjectJS(),
                ]
            );
    }
1230357
public static function processImageHtml($html, PageInterface $page)
    {
        $excerpt = static::getExcerptFromHtml($html, 'img');

        $original_src = $excerpt['element']['attributes']['src'];
        $excerpt['element']['attributes']['href'] = $original_src;

        $excerpt = static::processLinkExcerpt($excerpt, $page, 'image');

        $excerpt['element']['attributes']['src'] = $excerpt['element']['attributes']['href'];
        unset ($excerpt['element']['attributes']['href']);

        $excerpt = static::processImageExcerpt($excerpt, $page);

        $excerpt['element']['attributes']['data-src'] = $original_src;

        $html = static::getHtmlFromExcerpt($excerpt);

        return $html;
    }
733328
private function deletePageCache(PageInterface $page)
    {
        if (null !== $this->cache) {
            $this->cache->delete('ekyna_cms.page[route:' . $page->getRoute() . ']');
        }
    }
671814
protected function updateSeoPage(PageInterface $page)
    {
        if (!$this->seoPage) {
            return;
        }

        /*
         * Always prefer the page title, if set.
         * Do not use the (internal) page name as a fallback
         */
        if ($page->getTitle()) {
            $this->seoPage->setTitle($page->getTitle());
        }

        if ($page->getMetaDescription()) {
            $this->seoPage->addMeta('name', 'description', $page->getMetaDescription());
        }

        if ($page->getMetaKeyword()) {
            $this->seoPage->addMeta('name', 'keywords', $page->getMetaKeyword());
        }

        $this->seoPage->addMeta('property', 'og:type', 'article');
        $this->seoPage->addHtmlAttributes('prefix', 'og: http://ogp.me/ns#');
    }
298833
public function render($ifIssetGet = null): string
    {
        $this->setPageStart()->setPageEnd();

        return $this->htmlRenderer->render($ifIssetGet);
    }
613617
public static function renderType(ButtonInterface $button) {
        return null !== $button->getType() ? $button->getPrefix() . $button->getType() : null;
    }
684599
public function makePageSnapshot(PageInterface $page)
    {
        foreach ($page->getLayoutBlock() as $layoutBlock) {
            $layoutBlockContent = $this->registry->getManagerForClass($layoutBlock->getClassType())->getRepository($layoutBlock->getClassType())->find(
                $layoutBlock->getObjectId()
            );
            $layoutBlock->takeSnapshot($this->serializer->serialize($layoutBlockContent, 'json'));
        }

        $pageSnapshotClass = $this->pageSnapshotManager->getClassName();

        /** @var \Networking\InitCmsBundle\Model\PageSnapshotInterface $pageSnapshot */
        $pageSnapshot = new $pageSnapshotClass($page);
        $pageSnapshot->setVersionedData($this->serializer->serialize($page, 'json'))
            ->setPage($page);

        if ($oldPageSnapshot = $page->getSnapshot()) {
            $snapshotContentRoute = $oldPageSnapshot->getContentRoute();
        } else {
            $contentRouteClass = $this->contentRouteManager->getClassName();
            /** @var \Networking\InitCmsBundle\Model\ContentRouteInterface $snapshotContentRoute */
            $snapshotContentRoute = new $contentRouteClass();
        }

        $pageSnapshot->setContentRoute($snapshotContentRoute);
        $pageSnapshot->setPath(self::getPageRoutePath($page->getPath()));

        $om = $this->registry->getManagerForClass($pageSnapshotClass);
        $om->persist($pageSnapshot);
        $om->flush();

        $snapshotContentRoute->setPath(self::getPageRoutePath($page->getPath()));
        $snapshotContentRoute->setObjectId($pageSnapshot->getId());

        if ($oldPageSnapshot && ($oldPageSnapshot->getPath() != self::getPageRoutePath($page->getPath()))) {
            $this->phpCache->clean();
        }

        $om = $this->registry->getManagerForClass(get_class($snapshotContentRoute));
        $om->persist($snapshotContentRoute);
        $om->flush();
    }
69183
public function render_plans_to_review_page(renderable $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('block_lp/plans_to_review_page', $data);
    }
382679
public function render_print_book_page(print_book_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('booktool_print/print_book', $data);
    }
163934
public function getDirectTranslationFor(PageInterface $page)
    {
        foreach ($this->getAllTranslations() as $translation) {
            if ($translation->isDirectTranslation($page)) {
                return $translation;
            }
        }
    }
1230519
public function renderRequest(RequestInterface $request)
    {
        $return  = '';
        $return .= sprintf("URL:     %s\n", $request->getUri());
        $return .= sprintf("METHOD:  %s\n", $request->getMethod());

        if ($request->getHeaders()) {
            $return .= 'HEADERS:';
        }

        $indent = false;
        foreach ($request->getHeaders() as $name => $values) {
            if ($indent) {
                $return .= str_repeat(' ', 8);
            }

            $return .= sprintf(" %s: %s\n", $name, implode(', ', $values));
            $indent  = true;
        }

        if ($body = (string) $request->getBody()) {
            $return .= 'BODY:    ';

            switch ($request->getHeaderLine('Content-Type')) {
                case 'application/json':
                    $return .= json_encode(json_decode($body, true), JSON_PRETTY_PRINT);
                    break;
                default:
                    $return .= $body;
                    break;
            }

            $return .= "\n";
        }

        return $return;
    }
596067
private function loadBlocks(PageInterface $page)
    {
        $i = new \RecursiveIteratorIterator(new RecursiveBlockIterator($page->getBlocks()), \RecursiveIteratorIterator::SELF_FIRST);

        foreach ($i as $block) {
            $this->blocks[$block->getId()] = $block;
        }
    }
1287351
public function page($page)
    {
        //set the page
        $this->layout->page = $page;

        //set the layout content and title
        $this->layout->content = view($page);

        return $this->layout;
    }
289106
public function pageAction( $page = 1 )
    {
        $sitemap               = new DOMDocument( "1.0", "UTF-8" );
        $root                  = $sitemap->createElement( "urlset" );
        $sitemap->formatOutput = true;
        $root->setAttribute( "xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9" );
        $sitemap->appendChild( $root );
        $query         = $this->getQuery();
        $query->limit  = static::PACKET_MAX;
        $query->offset = static::PACKET_MAX * ( $page - 1 );

        $searchService = $this->get( "ezpublish.api.repository" )->getSearchService();

        $results = $searchService->findLocations( $query );
        $this->fillSitemap( $sitemap, $root, $results );

        $response = new Response( $sitemap->saveXML(), 200, [ "Content-type" => "text/xml" ] );
        $response->setSharedMaxAge( 24 * 3600 );

        return $response;
    }
1362319
final public function render($ifIssetGet = null): string
    {
        $html = '';

        $andIfHasQueryParams = $this->accumulateIfHasQueryParams($ifIssetGet);

        if ($this->pagination->getGetPP() != Pagination::ALL && $this->pagination->getCount() > $this->pagination->getPerPage()) {
            $html .= $this->open();

            $html .= $this->previousLink(Str::andIfHasQueryParams($andIfHasQueryParams));
            $html .= $this->firstLink(Str::andIfHasQueryParams($andIfHasQueryParams));

            for ($i = $this->pagination->getPageStart(); $i <= $this->pagination->getPageEnd(); $i++) {
                if ($i == $this->pagination->getCurrentPage()) {
                    $html .= $this->paginationActive($i);
                } else {
                    if ($i != 1 && $i != $this->pagination->getNbPages()) {
                        $html .= $this->paginationLink($i.Str::andIfHasQueryParams($andIfHasQueryParams), $i);
                    }
                }
            }

            $html .= $this->lastLink(Str::andIfHasQueryParams($andIfHasQueryParams));
            $html .= $this->nextLink(Str::andIfHasQueryParams($andIfHasQueryParams));

            $html .= $this->close();
        }

        return $html;
    }
285813
public function renderBoxes($idPage)
    {
        $this->reloadContent();

        $parameters = $this->getContext()->container->getParameters();
        $boxes = $parameters['boxes'];

        /*
        foreach ($boxes as &$box) {
            //$box['component'] = $id . '-' . $box['presenter'] . '-' . $box['function'];
        }*/
        if (!is_array($boxes)) {
            $boxes = array();
        }

        $this->template->actualPage = $this->actualPage;
        $this->template->boxes = $boxes;
        $this->template->idPage = $idPage;
    }
782468
public function setActivePage(PageInterface $page)
    {
        $this->page = $page;
        $this->app->instance(PageModel::class, $page);

        return $this;
    }