Render a single element block

@param  string $block
@param  string $element
@param  string $name
@return string
424913
protected function renderElement($block, $element, $name)
    {
        return $this->mustache->render($block, array(
            'element'   => $element,
            'name'      => $name,
            'type'      => $this->getInputType($name),
            'label'     => str_replace('_', ' ', ucwords($name)) . ':'
        ));
    }
182626
private void renderBlock(BlockNode block, Appendable to) {
    pushOutputBuf(to);
    visitChildren(block);
    popOutputBuf();
  }
1318507
private function getTwigBlockContent(
        TwigBlockDefinitionInterface $blockDefinition,
        Block $block,
        array $parameters
    ): string {
        if (!isset($parameters['twig_template'])) {
            return '';
        }

        if (!$parameters['twig_template'] instanceof ContextualizedTwigTemplate) {
            return '';
        }

        return $parameters['twig_template']->renderBlock(
            $blockDefinition->getTwigBlockName($block)
        );
    }
659647
public function hasElement($name)
    {
        foreach($this->elements as $element){
            if($element->getName() == $name) {
                return true;
            }
        }

        return false;
    }
967324
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
    {
        if (! ($block instanceof FencedCode or $block instanceof IndentedCode)) {
            throw new InvalidArgumentException('Incompatible block type: '.get_class($block));
        }

        $attrs = [];
        foreach ($block->getData('attributes', []) as $key => $value) {
            $attrs[$key] = $htmlRenderer->escape($value, true);
        }

        $highlighter = $this->getHighlighter();
        $infoWords = $block instanceof FencedCode ? $block->getInfoWords() : [];
        if (count($infoWords) !== 0 && strlen($infoWords[0]) !== 0) {
            $attrs['class'] = isset($attrs['class']) ? $attrs['class'].' ' : '';
            $attrs['class'] .= 'language-'.$htmlRenderer->escape($infoWords[0], true);
            $code = $highlighter->highlight($this->normalizeLang($infoWords[0]), $block->getStringContent());
        } else {
            $code = (object) [
                'value' => $htmlRenderer->escape($block->getStringContent()),
            ];
        }

        return new HtmlElement(
            'pre', [], new HtmlElement('code', $attrs, $this->lines($code->value))
        );
    }
1360083
public function render(ElementInterface $element, $blockWrapper = null, $inlineWrapper = null)
    {
        $html   = '';
        $inline = $element->getOption('help-inline');
        $block  = $element->getOption('help-block');
        if ($inline) {
            $html .= sprintf($inlineWrapper ?: $this->inlineWrapper, $inline);
        }
        if ($block) {
            $html .= sprintf($blockWrapper ?: $this->blockWrapper, $block);
        }
        return $html;
    }
643112
public function createElement(Node $parent, $name)
    {
        foreach ($this->registry[ElementExtension::class] as $extension) {
            $node = $extension->createElement($parent, $name);
            if ($node) {
                return $node;
            }
        }

        return null;
    }
265363
public function displayParentBlock($name, array $context, array $blocks = array())
    {
        $name = (string) $name;

        if (isset($this->traits[$name])) {
            $this->traits[$name][0]->displayBlock($name, $context, $blocks);
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, $blocks);
        } else {
            throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName());
        }
    }
616267
public function getElement($name)
    {
        if ($element = parent::getElement($name)) {
            return $element;
        } else {
            $subforms = $this->getSubForms();
            foreach($subforms as $subform) {
                if ($element = $subform->getElement($name)) {
                    return $element;
                }
            }
            return;
        }
    }
1022731
public static function renderBlocks($name, $args = array())
    {
        global $PPHP, $_SESSION;

        array_merge_assoc(
            self::$_stash,
            $args,
            array(
                'config' => $PPHP['config'],
                'session' => $_SESSION,
                'req' => grab('request')
            )
        );
        try {
            $template = self::$_twig->loadTemplate($name);
            $blockNames = $template->getBlockNames(self::$_stash);
            $results = array();
            foreach ($blockNames as $blockName) {
                $results[$blockName] = $template->renderBlock($blockName, self::$_stash);
            };
        } catch (\Exception $e) {
            echo $e->getMessage();
        };
        return $results;
    }
951676
public function renderBlock(string $blockName): string
    {
        if (!$this->template->hasBlock($blockName, $this->context, $this->blocks)) {
            return '';
        }

        $level = ob_get_level();
        ob_start();

        try {
            $this->template->displayBlock($blockName, $this->context, $this->blocks);
        } catch (Throwable $t) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }

            throw $t;
        }

        return (string) ob_get_clean();
    }
411895
protected function renderBlock($template, $block, $attributes = [])
    {
        $twig = $this->get('twig');
        $attributes = $twig->mergeGlobals($attributes);

        /** @var \Twig_Template $template */
        $template = $twig->loadTemplate($template);

        $level = ob_get_level();
        ob_start();

        try {
            $rendered = $template->renderBlock($block, $attributes);
            ob_end_clean();

            return $rendered;
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }

            throw $e;
        }
    }
206692
function renderElement(&$element, $required, $error)
    {
        $elAry = $this->_elementToArray($element, $required, $error);
        if (!empty($error)) {
            $this->_ary['errors'][$elAry['name']] = $error;
        }
        $this->_storeArray($elAry);
    }
359208
public function renderBlock(OutputBuffer $out, $name)
	{
		$method = 'block_' . $name;
		
		if(method_exists($this, $method))
		{
			$this->$method($out);
		}
		elseif($this->getParent() !== NULL)
		{
			$this->parent->renderBlock($out, $name);
		}
		else
		{
			throw new \RuntimeException(sprintf('Block not found: "%s"', $name));
		}
	}
142898
public function render(string $name, array $context = []): string
    {
        return $this->getTwig()->render($name, $context);
    }
762692
public function push($name, ...$element)
    {
        $result = true;
        foreach($element as $e)
        {
            $result &= $this->getInstance($name)->enqueue($e);
        }
        return $result;
    }
504171
public function replaceBlock(BlockElement $block, array $children = null)
    {
        if ($parent = $block->getParent()) {
            foreach (array_reverse($children ?: $block->getChildren()) as $child) {
                $parent->insertAfter($block, $child);
            }
            $previous = $block->getPreviousSibling();
            if ($previous instanceof TextElement) {
                $previous->setEnd(true);
            }
            $block->remove();
        }
    }