Render a page.

@param PageInterface $page Page to render

@return string Rendered content
495889
public function render(PageInterface $page)
    {
        $templateName = $this->locateTemplate();

        return $this
            ->engine
            ->render(
                $templateName, [
                    'page' => $page,
                ]
            );
    }
163934
public function getDirectTranslationFor(PageInterface $page)
    {
        foreach ($this->getAllTranslations() as $translation) {
            if ($translation->isDirectTranslation($page)) {
                return $translation;
            }
        }
    }
1257973
public function addTranslation(PageInterface $page)
    {
        $this->translations->add($page);
        $page->setOriginal($this);

        return $this;
    }
551460
public function render(ViewModelInterface $model)
    {
        foreach ($model as $child) {
            $groupId = $child->getGroupId();
            if (empty($groupId)) {
                continue;
            }
            $result    = $this->render($child);
            $oldResult = $model->getVariable($groupId, '');
            $model->setVariable($groupId, $oldResult . $result);
        }

        $events = $this->getEvents();
        $event  = new ViewEvent($model);
        $events->trigger($event);

        return $event->getResult();
    }
970977
public static function renderRequestHeaders(RequestInterface $request): string
    {
        $renderedHeaders = '';
        $headers = $request->getHeaders();
        if ($headers instanceof Headers) {
            $renderedHeaders .= $headers->__toString();
        } else {
            foreach (array_keys($headers) as $name) {
                $renderedHeaders .= $request->getHeaderLine($name);
            }
        }

        return $renderedHeaders;
    }
526961
private function loadBlocks(PageInterface $page)
    {
        $blocks = $this->blockInteractor->loadPageBlocks($page);

        // save a local cache
        foreach ($blocks as $block) {
            $this->blocks[$block->getId()] = $block;
        }
    }
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;
    }
1142722
public function render(DocumentInterface $document, $parameters = [])
    {
        $this->html = $this->htmlReport->render($document, $parameters);

        return $this->buildPdf($this->html);
    }
185180
public function fixUrl(PageInterface $page)
    {
        if ($page->isInternal()) {
            $page->setUrl(null); // internal routes do not have any url ...

            return;
        }

        // hybrid page cannot be altered
        if (!$page->isHybrid()) {
            // make sure Page has a valid url
            if ($page->getParent()) {
                if (!$page->getSlug()) {
                    $page->setSlug(Page::slugify($page->getName()));
                }

                if ('/' === $page->getParent()->getUrl()) {
                    $base = '/';
                } elseif ('/' !== mb_substr($page->getParent()->getUrl(), -1)) {
                    $base = $page->getParent()->getUrl() . '/';
                } else {
                    $base = $page->getParent()->getUrl();
                }

                if ('page_slug' === $page->getRouteName()) {
                    $page->setUrl($base . $page->getSlug() . '/');
                }
            } else {
                // a parent page does not have any slug - can have a custom url ...
                $page->setSlug(null);
                $page->setUrl('/' . $page->getSlug());
            }
        }

        foreach ($page->getChildren() as $child) {
            $this->fixUrl($child);
        }
    }
150739
public function removeTranslation(PageInterface $page)
    {
        $this->translations->removeElement($page);
        $page->getOriginals()->removeElement($this);

        return $this;
    }
980565
public function index(Page $page)
    {
        save_resource_url();

        $page->load('sections');

        return $this->view('titan::pages.components.page_components')->with('page', $page);
    }
461421
public function page(int $page)
    {
        $this->page = $page ? $page : $this->page;

        return $this;
    }
202783
public function push($page)
    {
        if (! ($page instanceof PageInterface)) {
            throw new \InvalidArgumentException('$page must be instance of PageInterface');
        }
        
        $this->offsetSet($page->getId(), $page);

        return $this;
    }
65466
public function render_print_book_chapter_page(print_book_chapter_page $page) {
        $data = $page->export_for_template($this);
        return parent::render_from_template('booktool_print/print_book_chapter', $data);
    }
101049
private function renderPage(Page $page, Request $request)
    {
        return $this->get('synapse')
            ->createDecorator($page)
            ->decorate(array(
                'page' => $page,
                'request' => $request,
            ))
        ;
    }
160015
public function renderMethod(MethodInterface $method)
    {
        if (!$method->supports(MethodInterface::BROWSER_PLATFORM)) {
            throw new \InvalidArgumentException('Renderer only accepts browser methods.');
        }

        return 'window.analytics.' . $method->getName() . '(' . $this->renderArguments($method) . ');';
    }
276631
private function isAdvanced(PageInterface $page)
    {
        if (null !== $controller = $page->getController()) {
            if (array_key_exists($controller, $this->pageConfig['controllers'])) {
                return $this->pageConfig['controllers'][$controller]['advanced'];
            }
            throw new \RuntimeException("Undefined page controller '{$controller}'.");
        }

        return null;
    }