FlexFormService
Utilities to process flexForms
Table of Contents
Methods
- convertFlexFormContentToArray() : array<string|int, mixed>
- Parses the flexForm content and converts it to an array The resulting array will be multi-dimensional, as a value "bla.blubb" results in two levels, and a value "bla.blubb.bla" results in three levels.
- convertFlexFormContentToSheetsArray() : array<string|int, mixed>
- Parses the flexForm content and converts it to an array.
- walkFlexFormNode() : mixed
- Parses a flexForm node recursively and takes care of sections etc
Methods
convertFlexFormContentToArray()
Parses the flexForm content and converts it to an array The resulting array will be multi-dimensional, as a value "bla.blubb" results in two levels, and a value "bla.blubb.bla" results in three levels.
public
convertFlexFormContentToArray(string $flexFormContent[, string $languagePointer = 'lDEF' ][, string $valuePointer = 'vDEF' ]) : array<string|int, mixed>
Note: multi-language flexForms are not supported yet
Parameters
- $flexFormContent : string
-
flexForm xml string
- $languagePointer : string = 'lDEF'
-
language pointer used in the flexForm
- $valuePointer : string = 'vDEF'
-
value pointer used in the flexForm
Return values
array<string|int, mixed>convertFlexFormContentToSheetsArray()
Parses the flexForm content and converts it to an array.
public
convertFlexFormContentToSheetsArray(string $flexFormContent[, string $languagePointer = 'lDEF' ][, string $valuePointer = 'vDEF' ]) : array<string|int, mixed>
The resulting array will be multi-dimensional. Sheets are respected to support property paths in multiple sheets.
A value such as "settings.pageId" results in three levels: "'sDEF' => ['settings' => ['pageId' => 123]]" and a value such as "settings.storages.newsPid" results in four levels: "'sDEF' => ['settings' => ['storages' => ['newsPid' => 123]]]"
Parameters
- $flexFormContent : string
-
flexForm xml string
- $languagePointer : string = 'lDEF'
-
language pointer used in the flexForm
- $valuePointer : string = 'vDEF'
-
value pointer used in the flexForm
Return values
array<string|int, mixed>walkFlexFormNode()
Parses a flexForm node recursively and takes care of sections etc
public
walkFlexFormNode(mixed $nodeArray[, string $valuePointer = 'vDEF' ]) : mixed
Parameters
- $nodeArray : mixed
-
The flexForm node to parse
- $valuePointer : string = 'vDEF'
-
The valuePointer to use for value retrieval