FieldWizard

class \TYPO3\CMS\Backend\Form\NodeExpansion\FieldWizard

Extends
AbstractNode

Field wizards are additional HTML on a single element level that are typically shown below the element input. They are registered in ['config']['fieldWizard'] TCA section and each element may merge that with default wizards.

Field wizards may add additional functionality to the element. They could add new ajax controllers for instance or add buttons and are not restricted by the framework further.

Examples for field wizards are the display of the "language diff" in input elements and the file upload button in group elements.

Table of Contents

Properties

$data  : array
Main data array to work on, given from parent to child elements
$defaultFieldControl  : array
A list of default field controls added to the element / container.
$defaultFieldInformation  : array
A list of default field information added to the element / container.
$defaultFieldWizard  : array
A list of default field wizards added to the element / container.
$nodeFactory  : NodeFactory
Instance of the node factory to create sub elements, container and single element expansions.

Methods

__construct()  : mixed
Set data to data array and register node factory to render sub elements
render()  : array
Order the list of field wizards to be rendered with the ordering service, then call each wizard element through the node factory and merge their results.
getValidationDataAsJsonString()  : string
Build JSON string for validations rules.
initializeResultArray()  : array
Initialize the array that is returned to parent after calling. This structure is identical for *all* nodes. Parent will merge the return of a child with its own stuff and in itself return an array of the same structure.
mergeChildReturnIntoExistingResult()  : array
Merge existing data with a child return array.

Properties

$data

Main data array to work on, given from parent to child elements

protected array $data = []

$defaultFieldControl

A list of default field controls added to the element / container.

protected array $defaultFieldControl = []

This property is often reset by single elements.

$defaultFieldInformation

A list of default field information added to the element / container.

protected array $defaultFieldInformation = []

$defaultFieldWizard

A list of default field wizards added to the element / container.

protected array $defaultFieldWizard = []

This property is often reset by single elements.

$nodeFactory

Instance of the node factory to create sub elements, container and single element expansions.

Deprecated

since TYPO3 v12.4. will be removed in TYPO3 v13.0.

protected NodeFactory $nodeFactory

Methods

__construct()

Set data to data array and register node factory to render sub elements

public __construct([NodeFactory|null $nodeFactory = null ][, array $data = [] ]) : mixed

Deprecated

since TYPO3 v12.4. Default constructor will be removed in v13.

Parameters

$nodeFactory : NodeFactory|null = null
$data : array = []

render()

Order the list of field wizards to be rendered with the ordering service, then call each wizard element through the node factory and merge their results.

public render() : array

Return values

array —

Result array

getValidationDataAsJsonString()

Build JSON string for validations rules.

protected getValidationDataAsJsonString(array $config) : string

Parameters

$config : array

Return values

string

initializeResultArray()

Initialize the array that is returned to parent after calling. This structure is identical for *all* nodes. Parent will merge the return of a child with its own stuff and in itself return an array of the same structure.

protected initializeResultArray() : array

Return values

array

mergeChildReturnIntoExistingResult()

Merge existing data with a child return array.

protected mergeChildReturnIntoExistingResult(array $existing, array $childReturn[, bool $mergeHtml = true ]) : array

The incoming $childReturn array should be initialized using initializeResultArray() beforehand.

Parameters

$existing : array

Currently merged array

$childReturn : array

Array returned by child

$mergeHtml : bool = true

If false, the ['html'] section of $childReturn will NOT be added to $existing

Return values

array —

Result array

On this page