[TYPO3-english] Saving FlexForms from Frontend

David Bruchmann david.bruchmann at gmail.com
Fri Jan 2 05:12:36 CET 2015


Hi,

working on an extension for TYPO3 v6.1 I still have to use pi_base as the
extension is just exceeded by me.

Saving flexforms from frontend I don't yet know how to get it done right.

using the functions array2xml_cs and xml2array seem never being really just
contrary, therefor my question.


The original flexform is saved like this:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>"
  ["$this->$pi_flexform"]=>
  string(1694) "<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
    <data>
        <sheet index="sDEF">
            <language index="lDEF">
                <field index="whatToDisplay">
                    <value index="vDEF">CONFIGURATION</value>
                </field>
                <field index="storagePid">
                    <value index="vDEF"></value>
                </field>
                <field index="templateFile">
                    <value
index="vDEF">EXT:my_extension/res/template.html</value>
                </field>
                <field index="EmailFrom">
                    <value index="vDEF"></value>
                </field>
                <field index="EmailFromName">
                    <value index="vDEF"></value>
                </field>
                <field index="EmailTemplate">
                    <value index="vDEF">Hello,

some text

Sincerly,

OUR COMPANYour-company at domain.comhttp://www.domain.com</value>
                </field>
                <field index="UIDcheckout">
                    <value index="vDEF">42</value>
                </field>
            </language>
        </sheet>
    </data>
</T3FlexForms>


But concerting the flexform to array and then back to xml with
array2xml_cs it's shown like this:


<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
	<data type="array">
		<sDEF type="array">
			<lDEF type="array">
				<whatToDisplay type="array">
					<vDEF>CONFIGURATION</vDEF>
				</whatToDisplay>
				<storagePid type="array">
					<vDEF></vDEF>
				</storagePid>
				<templateFile type="array">
					<vDEF>EXT:my_extension/res/template.html</vDEF>
				</templateFile>
				<EmailFrom type="array">
					<vDEF></vDEF>
				</EmailFrom>
				<EmailFromName type="array">
					<vDEF></vDEF>
				</EmailFromName>
				<EmailTemplate type="array">
					<vDEF>Hello,

some text

Sincerly,

OUR COMPANYour-company at domain.comhttp://www.domain.com</vDEF>
				</EmailTemplate>
				<UIDcheckout type="array">
					<vDEF>42</vDEF>
				</UIDcheckout>
			</lDEF>
		</sDEF>
	</data>
</T3FlexForms>


So the primary problem is how to handle the flexform and which functions to
use for converting array to xml before saving it with changed values again
in the database,

David


More information about the TYPO3-english mailing list