lib/View/Twig/ContextualizedTwigTemplate.php
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();
    }
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();
    }
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 ( ) ; }
Renders the provided block. If block does not exist, an empty string will be returned.

@throws \Throwable
Renders the provided block . If block does not exist an empty string will be returned .