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

getBlocksByField() private method

Template block convention name is _field Example: 'ezstring_field' will be relevant for a full view of ezstring field type.
private getBlocksByField ( string $fieldTypeIdentifier, integer $type, null | string | Twig_Templat\Twig_Template $localTemplate = null ) : array
$fieldTypeIdentifier string
$type integer Either self::VIEW or self::EDIT
$localTemplate null | string | Twig_Templat\Twig_Template a file where to look for the block first
return array
    private function getBlocksByField($fieldTypeIdentifier, $type, $localTemplate = null)
    {
        $fieldBlockName = $this->getRenderFieldBlockName($fieldTypeIdentifier, $type);
        if ($localTemplate !== null) {
            // $localTemplate might be a Twig_Template instance already (e.g. using _self Twig keyword)
            if (!$localTemplate instanceof Twig_Template) {
                $localTemplate = $this->twig->loadTemplate($localTemplate);
            }
            $block = $this->searchBlock($fieldBlockName, $localTemplate);
            if ($block !== null) {
                return [$fieldBlockName => $block];
            }
        }
        return $this->getBlockByName($fieldBlockName, $type === self::EDIT ? 'fieldEditResources' : 'fieldViewResources');
    }