[TYPO3-dev] getting data out of flexForm structure
Dr. Ronald P. Steiner
Ronald.Steiner at googlemail.com
Mon Feb 25 08:06:17 CET 2008
Daniel Pötzinger schrieb:
> Its ok to use xml2array if you want to transform the xml into an array.
> Flexforms are designed to work with this transformation. However you
> need to code the logic to get the relevant fields depending on the
> languagesetting and nesting in the DS.
$piFlexForm = t3lib_div::xml2array($flexForm);
$conf = array();
foreach ( $piFlexForm['data'] as $sheet => $data )
foreach ( $data as $lang => $value )
foreach ( $value as $key => $val )
$conf[$key] = $this->pi_getFFvalue($piFlexForm, $key, $sheet);
This lines amazingly enable language fall back. (- with the problem of
only one step fall back as is topic in the other posting)
> However there is a class like t3lib_flexformtools, which you can/should
> use for accessing data in the XML with a help of a callbackfunction.
> (example usage in l10nmgr)
Thanks for your tip. I checked this class but there seems no function
that could solve my task. - so I might stay with t3lib_div::xml2array
and then get the fields in the "correct" language afterwards.
greetings
Ron
More information about the TYPO3-dev
mailing list