eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::getBlockByName PHP Method

getBlockByName() private method

Returns the template block of the given $name available in the resources which name is $resourcesName.
private getBlockByName ( string $name, string $resourcesName ) : array
$name string
$resourcesName string
return array
    private function getBlockByName($name, $resourcesName)
    {
        if (isset($this->blocks[$name])) {
            return [$name => $this->blocks[$name]];
        }
        foreach ($this->{$resourcesName} as &$template) {
            if (!$template instanceof Twig_Template) {
                $template = $this->twig->loadTemplate($template['template']);
            }
            $tpl = $template;
            $block = $this->searchBlock($name, $tpl);
            if ($block !== null) {
                $this->blocks[$name] = $block;
                return [$name => $block];
            }
        }
        throw new MissingFieldBlockException("Cannot find '{$name}' template block.");
    }