FlexFormProcessor implements DataProcessorInterface
This data processor converts the XML structure of a given FlexForm field into a fluid readable array.
Options: fieldname - The name of the field containing the FlexForm to be converted references - A key / value list for fields with file references to process dataProcessing - Additional sub DataProcessors to process as - The variable, the generated array should be assigned to
Example of a minimal TypoScript configuration, which processes the field
pi_flexform
and assigns the array to the flexFormData
variable:
10 = TYPO3\CMS\Frontend\DataProcessing\FlexFormProcessor
Example of an advanced TypoScript configuration, which processes the field
my_flexform_field
, resolves its FAL references and assigns the array to the
myOutputVariable
variable:
10 = TYPO3\CMS\Frontend\DataProcessing\FlexFormProcessor 10 { fieldName = my_flexform_field references { my_flex_form_group.my_flex_form_field = my_field_reference } dataProcessing { 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor 10 { references.fieldName = media } } as = myOutputVariable }
Table of Contents
Interfaces
- DataProcessorInterface
- Interface for data processor classes processing data from ContentObjectRenderer, used e.g. with the FLUIDTEMPLATE content object
Methods
- process() : array<string|int, mixed>
- Process content object data
- processAdditionalDataProcessors() : array<string|int, mixed>
- Recursively process sub processors of a data processor
- processFileReferences() : void
- Recursively process FAL references and replace them by FAL objects.
Methods
process()
Process content object data
public
process(ContentObjectRenderer $cObj, array<string|int, mixed> $contentObjectConfiguration, array<string|int, mixed> $processorConfiguration, array<string|int, mixed> $processedData) : array<string|int, mixed>
Parameters
- $cObj : ContentObjectRenderer
-
The data of the content element or page
- $contentObjectConfiguration : array<string|int, mixed>
-
The configuration of Content Object
- $processorConfiguration : array<string|int, mixed>
-
The configuration of this processor
- $processedData : array<string|int, mixed>
-
Key/value store of processed data (e.g. to be passed to a Fluid View)
Return values
array<string|int, mixed> —the processed data as key/value store
processAdditionalDataProcessors()
Recursively process sub processors of a data processor
protected
processAdditionalDataProcessors(array<string|int, mixed> $data, array<string|int, mixed> $processorConfiguration, ServerRequestInterface $request) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
- $processorConfiguration : array<string|int, mixed>
- $request : ServerRequestInterface
Return values
array<string|int, mixed>processFileReferences()
Recursively process FAL references and replace them by FAL objects.
protected
processFileReferences(ContentObjectRenderer $cObj, array<string|int, mixed> &$data, array<string|int, mixed> $fields) : void
Parameters
- $cObj : ContentObjectRenderer
- $data : array<string|int, mixed>
- $fields : array<string|int, mixed>