Feature #50962
closedt3lib_flexformtools still missing simple method for reading FlexForm-Data
0%
Description
FlexForm's are used more and more in TYPO3. But as far as I know there's still missing core-method for simple data-retrival.
The Core-Class t3lib_flexformtools
has some methods for data traversing. But in my opinion this covers only one common need.
To simply retrieve the FlexForm-Data (saved FlexForm) as array, there don't seem to be any method yet. As currently every deveoper seems to cook his own soup on this, I think t3lib_flexformtools
would be the right way to implement something on this.
I would expect a method like this:
Method:
t3lib_flexformtools::flexData2xml( string $flexXML, # The FlexForm XML $singleField = null #(optional) bool $allLanguages = false, int $languageUid = 0 # (default is always the current sys_language_uid!) )
I would expect this result:
1. Using argument $allLanguages=true
f.e.
Array( // Array of Rows by LanguageKey 'lDEF' => Array( 'field_hello' => 'hello world', ), '1' => Array( 'field_hello' => 'hallo welt', ), );
2. Using argument $allLanguages=false
f.e.
(Say sys_language_uid is "1") Array( 'field_hello' => 'hallo welt', );
As first draft:
This method could be implemted upon t3lib_flexformtools::traverseFlexFormXMLData
which already exists for use with Callback-Functions.
Implementing a private function as reader for our flexData2xml
, this shouldn't be too much complicated.
If there is some positive feedback I would try to invest my time to provide a patch. Please give feedback or improvements or just post "please do" - to let me know if it is worth investing time for posting a patch here.