[TYPO3-dev] getting data out of flexForm structure

Franz Koch typo.removeformessage at fx-graefix.de
Sun Feb 24 20:54:26 CET 2008


Hi,
> I'm working on an extension.
> - it basically gets the data fields of a certain content element and 
> reads them into an array. If the content element contains flex form this 
> array will contain fields like:
> 
> $array['pi_flexform'] = '<?xml version="1.0" encoding="utf-8" 
> standalone="yes" ?> <T3FlexForms> ....';
> 
> I now want to transform this information into an array. Any one got an 
> idea?
> 
> Just to mention, the following will not work:
> #####
> $this->pi_initPIflexForm();
> $conf = array();
> $piFlexForm = $this->cObj->data['pi_flexform'];
> foreach ( $piFlexForm['data'] as $sheet => $data )
>    foreach ( $data as $lang => $value )
>        foreach ( $value as $key => $val )
>           $conf[$key] = $this->pi_getFFvalue($piFlexForm, $key, $sheet);
> #####
> cause $this->pi_initPIflexForm() writes the flex-form data of the 
> current plugin into $this->cObj->data['pi_flexform'];

Have you had a look at the function pi_initPIflexForm? It's just a 
wrapper for t3lib_div::xml2array($flexData). So I think all you need is 
this function :)

--
kind regards,
Franz




More information about the TYPO3-dev mailing list