Skip to content
Snippets Groups Projects
Commit c702f446 authored by Christian Kuhn's avatar Christian Kuhn Committed by Andreas Fernandez
Browse files

[TASK] Allow customData in FormEngine data compiler

FormEngine is a two-fold process: First all dependent data is
compiled into main "data array" by data providers, then the render
engine uses this array to render forms.

The main data array is restricted, top level keys can not be added
or removed by single data providers.

With the recent refactorings on element level, it is now much easier
to create powerful extensions to single elements. Those may need
additional data, the rest of the FormEngine doesn't know about.

To allow custom data providers adding data that is not related
to other keys from the data array, a general "customData" is
introduced to the array. This is not filled nor used by core
related classes, but it can be used by extensions to park data here.

For v9, we will probably see another patch giving the form data groups
control about the data array structure, but that may follow later.
For v8 and v7, allowing custom data should solve the one or
the other data provider usage for now.

C...
parent a5c513a3
Branches
Tags
No related merge requests found
......@@ -296,6 +296,12 @@ class FormDataCompiler
// of FormEngine to add runtime data. Containers and elements add data here which is given to
// sub-containers, elements, controls and wizards.
'renderData' => [],
// A place for non-core, additional, custom data providers to add data. If a data provider needs to add
// additional data to the data array that doesn't fit elsewhere, it can place it here to use it in the
// render part again. Data in here should be namespaced in a way that it does not collide with other
// data providers adding further data here. Using the extension key as array key could be a good idea.
'customData' => [],
];
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment