[TYPO3-dev] Reading FlexForm data from processDatamap_preProcessFieldArray hook
Bernhard Kraft
kraftb at kraftb.at
Wed Jan 11 01:24:36 CET 2006
Steve Webster wrote:
> Hi All,
>
> I am developing an extension where I want to manipulate the contents of
> my FlexForm in the processDatamap_preProcessFieldArray hook. E.g. when
> someone clicks the save button I want to also write a local XML file
> before writing to the DB.
>
> I can manipulate the $incomingFieldArray manually and pull the data out
> but I really wanted to use one of the built in methods to do this for
> future proofing. Is there any static methods I can use, the only ones I
> can find are within tslib_pibase and therefore need to be instantiated
> first?
If you just require to transform the XML data to an php array and vice versa
you will probably like:
t3lib_div::xml2array(...);
t3lib_div::array2xml(...);
If you want to access the fields within the PHP array structure one must say
that there are rarely no APIs/wrappers.
Those in tslib_pibase don't concern about the language settings lDEF and vDEF
AFAIK (correct me if im wrong)
also they are not really usable to get a repeated content element out of a
flexform XML/php structure.
In those extensions where I used Flexforms and respected language variables
I had a look at how TV get's the values for lDEF and vDEF (grep for it in TV sources)
and resemebled that for BE and FE.
Then I accessed the PHP data structure directly (print_r or debug_array is your friend)
greets,
Bernhard
More information about the TYPO3-dev
mailing list