Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer Class Reference
Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer:

## Public Member Functions
| setTwig (Twig_Environment $twig)
| setBaseTemplate ($baseTemplate)
| setFieldViewResources (array $fieldViewResources=null)
| setFieldEditResources (array $fieldEditResources=null)
| setFieldDefinitionViewResources (array $fieldDefinitionViewResources=null)
| setFieldDefinitionEditResources (array $fieldDefinitionEditResources=null)
| sortResourcesCallback (array $a, array $b)
| renderContentFieldView (Field $field, $fieldTypeIdentifier, array $params=[])
| Renders the HTML view markup for a given field. More...
| renderContentFieldEdit (Field $field, $fieldTypeIdentifier, array $params=[])
| Renders the HTML edit markup for a given field. More...
| renderFieldDefinitionView (FieldDefinition $fieldDefinition, array $params=[])
| Renders the HTML view markup for the given field definition. More...
| renderFieldDefinitionEdit (FieldDefinition $fieldDefinition, array $params=[])
| Renders the HTML edot markup for the given field definition. More...

## Public Attributes
const | VIEW = 1
const | EDIT = 2
const | FIELD_VIEW_SUFFIX = '_field'
const | FIELD_EDIT_SUFFIX = '_field_edit'
const | FIELD_DEFINITION_VIEW_SUFFIX = '_settings'
const | FIELD_DEFINITION_EDIT_SUFFIX = '_field_definition_edit'

## Private Member Functions
| renderContentField (Field $field, $fieldTypeIdentifier, array $params, $type)
| renderFieldDefinition (FieldDefinition $fieldDefinition, array $params, $type)
| searchBlock ($blockName, Twig_Template $tpl)
| Returns the block named $blockName in the given template. More...
| getBlocksByField ($fieldTypeIdentifier, $type, $localTemplate=null)
| Returns template blocks for $fieldTypeIdentifier. More...
| getBlocksByFieldDefinition (FieldDefinition $definition, $type)
| Returns the template block for the settings of the field definition $definition. More...
| getBlockByName ($name, $resourcesName)
| Returns the template block of the given $name available in the resources which name is $resourcesName. More...
| getRenderFieldBlockName ($fieldTypeIdentifier, $type)
| Returns expected block name for $fieldTypeIdentifier, attached in $content. More...
| getRenderFieldDefinitionBlockName ($fieldTypeIdentifier, $type)
| Returns the name of the block to render the settings of the field definition $definition. More...

## Private Attributes
| $twig
| $fieldViewResources = []
| $fieldEditResources = []
| $fieldDefinitionViewResources = []
| $fieldDefinitionEditResources = []
| $baseTemplate
| $blocks = []

## Detailed Description

Definition at line 16 of file FieldBlockRenderer.php.

## Member Function Documentation

## ◆ getBlockByName()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::getBlockByName | ( |  | $name,
|  |  | $resourcesName
| ) |  |
| private

Returns the template block of the given $name available in the resources which name is $resourcesName.

Parameters

  string | $name |
  string | $resourcesName |

Returns
  array

Definition at line 299 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\searchBlock().

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByField(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByFieldDefinition().

## ◆ getBlocksByField()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::getBlocksByField | ( |  | $fieldTypeIdentifier,
|  |  | $type,
|  |  | $localTemplate = `null`
| ) |  |
| private

Returns template blocks for $fieldTypeIdentifier.

First check in the $localTemplate if it's provided. Template block convention name is <fieldTypeIdentifier>_field Example: 'ezstring_field' will be relevant for a full view of ezstring field type.

Parameters

  string | $fieldTypeIdentifier |
  int | $type | Either self::VIEW or self::EDIT
  string | Twig_Template | null | $localTemplate | a file where to look for the block first

Returns
  array

Definition at line 256 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlockByName(), eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldBlockName(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\searchBlock().

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentField().

## ◆ getBlocksByFieldDefinition()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::getBlocksByFieldDefinition | ( | FieldDefinition | $definition,
|  |  | $type
| ) |  |
| private

Returns the template block for the settings of the field definition $definition.

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition | $definition |
  int | $type | Either self::VIEW or self::EDIT

Returns
  array

Definition at line 282 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlockByName(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldDefinitionBlockName().

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinition().

## ◆ getRenderFieldBlockName()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::getRenderFieldBlockName | ( |  | $fieldTypeIdentifier,
|  |  | $type
| ) |  |
| private

Returns expected block name for $fieldTypeIdentifier, attached in $content.

Parameters

  string | $fieldTypeIdentifier |
  int | $type | Either self::VIEW or self::EDIT

Returns
  string

Definition at line 331 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\FIELD_EDIT_SUFFIX, and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\FIELD_VIEW_SUFFIX.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByField(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentField().

## ◆ getRenderFieldDefinitionBlockName()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::getRenderFieldDefinitionBlockName | ( |  | $fieldTypeIdentifier,
|  |  | $type
| ) |  |
| private

Returns the name of the block to render the settings of the field definition $definition.

Parameters

  string | $fieldTypeIdentifier |
  int | $type | Either self::VIEW or self::EDIT

Returns
  string

Definition at line 347 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\FIELD_DEFINITION_EDIT_SUFFIX, and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\FIELD_DEFINITION_VIEW_SUFFIX.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByFieldDefinition(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinition().

## ◆ renderContentField()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::renderContentField | ( | Field | $field,
|  |  | $fieldTypeIdentifier,
|  | array | $params,
|  |  | $type
| ) |  |
| private

Parameters

  Field | $field |
  string | $fieldTypeIdentifier |
  array | $params |
  int | $type | Either self::VIEW or self::EDIT

Exceptions

  MissingFieldBlockException | If no template block can be found for $field

Returns
  string

Definition at line 156 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$blocks, eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByField(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldBlockName().

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentFieldEdit(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentFieldView().

## ◆ renderContentFieldEdit()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::renderContentFieldEdit | ( | Field | $field,
|  |  | $fieldTypeIdentifier,
|  | array | $params = `[]`
| ) |  |

Renders the HTML edit markup for a given field.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Field | $field |
  string | $fieldTypeIdentifier | FieldType identifier for $field
  array | $params | An array of parameters to pass to the field edit view

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\Templating\FieldBlockRendererInterface.

Definition at line 141 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentField().

## ◆ renderContentFieldView()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::renderContentFieldView | ( | Field | $field,
|  |  | $fieldTypeIdentifier,
|  | array | $params = `[]`
| ) |  |

Renders the HTML view markup for a given field.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Field | $field |
  string | $fieldTypeIdentifier | FieldType identifier for $field
  array | $params | An array of parameters to pass to the field view

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\Templating\FieldBlockRendererInterface.

Definition at line 136 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentField().

## ◆ renderFieldDefinition()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::renderFieldDefinition | ( | FieldDefinition | $fieldDefinition,
|  | array | $params,
|  |  | $type
| ) |  |
| private

Parameters

  FieldDefinition | $fieldDefinition |
  array | $params |
  int | $type | Either self::VIEW or self::EDIT

Returns
  string

Definition at line 200 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$blocks, eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByFieldDefinition(), eZ\Publish\API\Repository\Values\ContentType\FieldDefinition\getFieldSettings(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldDefinitionBlockName().

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinitionEdit(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinitionView().

## ◆ renderFieldDefinitionEdit()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::renderFieldDefinitionEdit | ( | FieldDefinition | $fieldDefinition,
|  | array | $params = `[]`
| ) |  |

Renders the HTML edot markup for the given field definition.

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition | $fieldDefinition |

Returns
  string

Implements eZ\Publish\Core\MVC\Symfony\Templating\FieldBlockRendererInterface.

Definition at line 188 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinition().

## ◆ renderFieldDefinitionView()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::renderFieldDefinitionView | ( | FieldDefinition | $fieldDefinition,
|  | array | $params = `[]`
| ) |  |

Renders the HTML view markup for the given field definition.

Parameters

  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition | $fieldDefinition |

Returns
  string

Implements eZ\Publish\Core\MVC\Symfony\Templating\FieldBlockRendererInterface.

Definition at line 183 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinition().

## ◆ searchBlock()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::searchBlock | ( |  | $blockName,
|  | Twig_Template | $tpl
| ) |  |
| private

Returns the block named $blockName in the given template.

If it's not found, returns null.

Parameters

  string | $blockName |
  Twig_Template | $tpl |

Returns
  array|null

Definition at line 230 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlockByName(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getBlocksByField().

## ◆ setBaseTemplate()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::setBaseTemplate | ( |  | $baseTemplate | ) |

Parameters

  string | Twig_Template | $baseTemplate |

Definition at line 90 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$baseTemplate.

## ◆ setFieldDefinitionEditResources()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::setFieldDefinitionEditResources | ( | array | $fieldDefinitionEditResources = `null` | ) |

Parameters

  array | $fieldDefinitionEditResources |

Definition at line 125 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$fieldDefinitionEditResources.

## ◆ setFieldDefinitionViewResources()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::setFieldDefinitionViewResources | ( | array | $fieldDefinitionViewResources = `null` | ) |

Parameters

  array | $fieldDefinitionViewResources |

Definition at line 116 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$fieldDefinitionViewResources.

## ◆ setFieldEditResources()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::setFieldEditResources | ( | array | $fieldEditResources = `null` | ) |

Parameters

  array | $fieldEditResources |

Definition at line 107 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$fieldEditResources.

## ◆ setFieldViewResources()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::setFieldViewResources | ( | array | $fieldViewResources = `null` | ) |

Parameters

  array | $fieldViewResources |

Definition at line 98 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$fieldViewResources.

## ◆ setTwig()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::setTwig | ( | Twig_Environment | $twig | ) |

Parameters

  Twig_Environment | $twig |

Definition at line 82 of file FieldBlockRenderer.php.

References eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\$twig.

## ◆ sortResourcesCallback()

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::sortResourcesCallback | ( | array | $a,
|  | array | $b
| ) |  |

Definition at line 131 of file FieldBlockRenderer.php.

## Member Data Documentation

## ◆ $baseTemplate

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$baseTemplate
| private

Definition at line 70 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\setBaseTemplate().

## ◆ $blocks

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$blocks = []
| private

Definition at line 77 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderContentField(), and eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\renderFieldDefinition().

## ◆ $fieldDefinitionEditResources

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$fieldDefinitionEditResources = []
| private

Definition at line 63 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\setFieldDefinitionEditResources().

## ◆ $fieldDefinitionViewResources

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$fieldDefinitionViewResources = []
| private

Definition at line 54 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\setFieldDefinitionViewResources().

## ◆ $fieldEditResources

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$fieldEditResources = []
| private

Definition at line 45 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\setFieldEditResources().

## ◆ $fieldViewResources

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$fieldViewResources = []
| private

Definition at line 36 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\setFieldViewResources().

## ◆ $twig

eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::$twig
| private

Definition at line 27 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\setTwig().

## ◆ EDIT

const eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::EDIT = 2

Definition at line 19 of file FieldBlockRenderer.php.

## ◆ FIELD_DEFINITION_EDIT_SUFFIX

const eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::FIELD_DEFINITION_EDIT_SUFFIX = '_field_definition_edit'

Definition at line 24 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldDefinitionBlockName().

## ◆ FIELD_DEFINITION_VIEW_SUFFIX

const eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::FIELD_DEFINITION_VIEW_SUFFIX = '_settings'

Definition at line 23 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldDefinitionBlockName().

## ◆ FIELD_EDIT_SUFFIX

const eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::FIELD_EDIT_SUFFIX = '_field_edit'

Definition at line 22 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldBlockName().

## ◆ FIELD_VIEW_SUFFIX

const eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::FIELD_VIEW_SUFFIX = '_field'

Definition at line 21 of file FieldBlockRenderer.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer\getRenderFieldBlockName().

## ◆ VIEW

const eZ\Publish\Core\MVC\Symfony\Templating\Twig\FieldBlockRenderer::VIEW = 1

Definition at line 18 of file FieldBlockRenderer.php.

The documentation for this class was generated from the following file:

- FieldBlockRenderer.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.