Does TYPO3 has any advanced API to handle FlexForms manipulations?


February 2019


758 time


Does TYPO3 (or probably some developer extensions) proposes some API helpers to get / set values for FlexForms XML, which are used in plugins configurations (BE/eID usage also) ?

2 answers


For the moment, the easiest way I found to manipulate TYPO3 flexforms (plugin configuration in my case) is following snippet :

$flexformArray = t3lib_div::xml2array($flexformXml);
// Data manipulation here ...
$flexObj = t3lib_div::makeInstance('t3lib_flexformtools');
$xml = $flexObj->flexArray2Xml($flexformArray, true);

So, we are obliged to pass by PHP array to make modifications in XML data.

If somebody proposes better way, You are welcome to share it.


Have a look at flux, an extbase-extension

Pros: - Write FlexForms in fluid - Dynamic reloading of parts of forms when something changes - Abitity to hook into load/save of flexform values and do additional processing

Cons: - Needs fed, which is huge and overkill if you just want a better way to dealing with flexforms - For me, at least, it had some bugs

However, even if you do not use it, it makes sense to download it and have a look at the code. You can learn a lot about how T3 handles FlexForms internally and perhaps come up with a simpler way to solve your problem.