Renders the element map for a category within the category editor, given the current Twig context.
@param array $context The incoming Twig context.
549719
public function renderCategoryElementMap(array &$context)
	{
		$map = $this->renderer->getElementMap($context['category']['id'], $context['site']['id']);
		return $this->renderMap($map);
	}
142898
public function render(string $name, array $context = []): string
    {
        return $this->getTwig()->render($name, $context);
    }
560558
protected function renderTemplate($template, array $context = [])
    {
        $app = $this->getContainer();

        if ($this->pathAdded === false) {
            $this->addTwigPath('templates');
            $this->pathAdded = true;
        }

        return $app['twig']->render($template, $context);
    }
482463
public function render($context = [])
    {
        $this->getRenderer()->setElement($this);
        return $this->getRenderer()->render($context);
    }
51152
public function render(string $layout = null, array $context = [])
    {
        if (null === $layout) {
            $layout = 'default';
        }
        $type = $this->getFlexType();

        $grav = Grav::instance();

        /** @var Debugger $debugger */
        $debugger = $grav['debugger'];
        $debugger->startTimer('flex-collection-' . ($debugKey =  uniqid($type, false)), 'Render Collection ' . $type . ' (' . $layout . ')');

        $cache = $key = null;
        foreach ($context as $value) {
            if (!\is_scalar($value)) {
                $key = false;
            }
        }

        if ($key !== false) {
            $key = md5($this->getCacheKey() . '.' . $layout . json_encode($context));
            $cache = $this->getCache('render');
        }

        try {
            $data = $cache ? $cache->get($key) : null;

            $block = $data ? HtmlBlock::fromArray($data) : null;
        } catch (InvalidArgumentException $e) {
            $debugger->addException($e);
            $block = null;
        } catch (\InvalidArgumentException $e) {
            $debugger->addException($e);
            $block = null;
        }

        $checksum = $this->getCacheChecksum();
        if ($block && $checksum !== $block->getChecksum()) {
            $block = null;
        }

        if (!$block) {
            $block = HtmlBlock::create($key);
            $block->setChecksum($checksum);
            if ($key === false) {
                $block->disableCache();
            }

            $grav->fireEvent('onFlexCollectionRender', new Event([
                'collection' => $this,
                'layout' => &$layout,
                'context' => &$context
            ]));

            $output = $this->getTemplate($layout)->render(
                ['grav' => $grav, 'config' => $grav['config'], 'block' => $block, 'collection' => $this, 'layout' => $layout] + $context
            );

            if ($debugger->enabled()) {
                $output = "\n<!–– START {$type} collection ––>\n{$output}\n<!–– END {$type} collection ––>\n";
            }

            $block->setContent($output);

            try {
                $cache && $block->isCached() && $cache->set($key, $block->toArray());
            } catch (InvalidArgumentException $e) {
                $debugger->addException($e);
            }
        }

        $debugger->stopTimer('flex-collection-' . $debugKey);

        return $block;
    }
254540
protected function _actionRender(KViewContext $context)
    {
        $format = $this->getFormat(); //format cannot be changed through context
        $layout = $context->layout;

        if(!parse_url($layout, PHP_URL_SCHEME))
        {
            //Handle partial layout paths
            if (is_string($layout) && strpos($layout, '.') === false)
            {
                $identifier = $this->getIdentifier()->toArray();
                $identifier['name'] = $layout;
                unset($identifier['path'][0]);

                $layout = (string) $this->getIdentifier($identifier);
            }
        }

        $data = KObjectConfig::unbox($context->data);

        //Render the template
        $content = $this->getTemplate()
            ->loadFile((string) $layout.'.'.$format)
            ->setParameters($context->parameters)
            ->render($data);

        //Set the content
        $this->setContent($content);

        return parent::_actionRender($context);
    }
574314
protected function _actionRender(ViewContext $context)
    {
        $data = ObjectConfig::unbox($context->data);
        $path = $this->qualifyLayout($context->layout);

        //Render the template
        $content = $this->getTemplate()
            ->setParameters($context->parameters)
            ->render($path, $data);

        return $content;
    }
477267
public function render($context = [])
    {
        $this->element->setValue(
            $this->translate($this->element->getValue())
        );
        return parent::render($context);
    }
307540
public function render($xml, $context = null, ServerRequestInterface $request = null)
    {
        $renderer = $this->getRenderer();

        $this->events->dispatch(new Rendering($renderer, $context, $xml, $request));

        return $renderer->render($xml);
    }
1185160
protected function _actionRender(KViewContext $context)
    {
        if(empty($this->module->content))
        {
            $format = $this->getFormat(); //format cannot be changed through context
            $layout = $context->layout;

            if (is_string($layout) && strpos($layout, '.') === false)
            {
                $identifier = $this->getIdentifier()->toArray();
                $identifier['name'] = $layout;

                $layout = (string) $this->getIdentifier($identifier);
            }

            //Unpack the data (first level only)
            $data = array();
            foreach($context->data as $key => $value) {
                $data[$key] = $value;
            }

            $this->_content = $this->getTemplate()
                ->loadFile($layout.'.'.$format)
                ->setParameters($context->parameters)
                ->render($data);
        }
        else
        {
            $this->_content = $this->getTemplate()
                ->loadString($this->module->content)
                ->setParameters($context->parameters)
                ->filter();
        }

        return $this->_content;
    }
1343758
public function render() : void
    {
        $langRoot = $this->categoryRepository->findLangRoot($this->activeLang);

        $categories = [];

        if ($langRoot && $langRoot->getDescendants() instanceof ObjectCollection)
        {
            $root = $this->categoryRepository->findDescendants($langRoot);
            $left = (count($root) > 0) ? $root[0]->getLeftValue() - 1 : 0;
            $categories = $this->nested->getTree($root, $left);
        }

        $this->template->categories = $categories;
        $this->template->setFile(__DIR__ . '/templates/modal.latte');
        $this->template->render();
    }
903039
private function createDomDocument(array $context): \DOMDocument
    {
        $document = new \DOMDocument();

        // Set an attribute on the DOM document specifying, as part of the XML declaration,
        $xmlOptions = [
            // nicely formats output with indentation and extra space
            self::FORMAT_OUTPUT => 'formatOutput',
            // the version number of the document
            self::VERSION => 'xmlVersion',
            // the encoding of the document
            self::ENCODING => 'encoding',
            // whether the document is standalone
            self::STANDALONE => 'xmlStandalone',
        ];
        foreach ($xmlOptions as $xmlOption => $documentProperty) {
            if ($contextOption = $context[$xmlOption] ?? $this->defaultContext[$xmlOption] ?? false) {
                $document->$documentProperty = $contextOption;
            }
        }

        return $document;
    }
905417
protected function _beforeRender(KControllerContextInterface $context)
    {
        $cache  = $this->_getCache($this->_getGroup(), 'output');
        $key    = $this->_getKey();

        if($data = $cache->get($key))
        {
            $data = unserialize($data);

            //Render the view output
            $context->result = $data['component'];

            //Render the modules
            if(isset($data['modules']))
            {
                foreach($data['modules'] as $name => $content) {
                    JFactory::getDocument()->setBuffer($content, 'modules', $name);
                }
            }

            $this->_output = $context->result;
        }
    }
404774
public function render(array $data, ContextInterface $context)
    {
        $data = $this->applyButtonClasses($data);

        return parent::render($data, $context);
    }
936549
protected function assimilateContext(array $context = [])
    {
        $this->_context_ = $context;
        foreach ($context as $key => $value) {
            $this->$key = $value;
        }
    }
422276
protected function render($template, $context = [])
    {
        $context = array_merge($this->_context, $context);
        $body = $this->twig->render($template, $context);
        return $body;
    }
933408
private function processCategory(array $element, $parent = null)
    {
        if ($this->isMasterCategory($element)) {
            $this->createCategory($element, MasterCategoryElement::class, $this->parseResult);
        }

        if ($this->isResourceGroup($element)) {
            $this->createCategory($element, ResourceGroupElement::class, $parent);
        }

        if ($this->isDataStructureCategory($element)) {
            $this->createCategory($element, DataStructureCategoryElement::class, $parent);
        }
    }