eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FieldRenderingExtension::getRenderFieldBlockParameters PHP Метод

getRenderFieldBlockParameters() приватный Метод

Generates the array of parameter to pass to the field template.
private getRenderFieldBlockParameters ( eZ\Publish\API\Repository\Values\Content\Content $content, eZ\Publish\API\Repository\Values\Content\Field $field, array $params = [] ) : array
$content eZ\Publish\API\Repository\Values\Content\Content
$field eZ\Publish\API\Repository\Values\Content\Field the Field to display
$params array An array of parameters to pass to the field view
Результат array
    private function getRenderFieldBlockParameters(Content $content, Field $field, array $params = [])
    {
        // Merging passed parameters to default ones
        $params += ['parameters' => [], 'attr' => []];
        $versionInfo = $content->getVersionInfo();
        $contentInfo = $versionInfo->getContentInfo();
        $contentType = $this->contentTypeService->loadContentType($contentInfo->contentTypeId);
        $fieldDefinition = $contentType->getFieldDefinition($field->fieldDefIdentifier);
        // Adding Field, FieldSettings and ContentInfo objects to
        // parameters to be passed to the template
        $params += ['field' => $field, 'content' => $content, 'contentInfo' => $contentInfo, 'versionInfo' => $versionInfo, 'fieldSettings' => $fieldDefinition->getFieldSettings()];
        // Adding field type specific parameters if any.
        if ($this->parameterProviderRegistry->hasParameterProvider($fieldDefinition->fieldTypeIdentifier)) {
            $params['parameters'] += $this->parameterProviderRegistry->getParameterProvider($fieldDefinition->fieldTypeIdentifier)->getViewParameters($field);
        }
        // make sure we can easily add class="<fieldtypeidentifier>-field" to the
        // generated HTML
        if (isset($params['attr']['class'])) {
            $params['attr']['class'] .= ' ' . $this->getFieldTypeIdentifier($content, $field) . '-field';
        } else {
            $params['attr']['class'] = $this->getFieldTypeIdentifier($content, $field) . '-field';
        }
        return $params;
    }