src/Twig.php
public function fetchBlock($template, $block, $data = [])
    {
        $data = array_merge($this->defaultVariables, $data);

        return $this->environment->loadTemplate($template)->renderBlock($block, $data);
    }
public function fetchBlock($template, $block, $data = [])
    {
        $data = array_merge($this->defaultVariables, $data);

        return $this->environment->loadTemplate($template)->renderBlock($block, $data);
    }
public function fetchBlock ( $ template , $ block , $ data = [ ] ) { $ data = array_merge ( $ this -> defaultVariables , $ data ) ; return $ this -> environment -> loadTemplate ( $ template ) -> renderBlock ( $ block , $ data ) ; }
Fetch rendered block

@param  string $template Template pathname relative to templates directory
@param  string $block    Name of the block within the template
@param  array  $data     Associative array of template variables

@return string
Fetch rendered block