[TYPO3-mvc] Fluid: support for object of class SimpleXMLElement?

Roland most.wanted at gmx.at
Thu Jul 19 10:21:15 CEST 2012


hi everybody,

i am not sure, but i think i just noticed some kind of incomplete 
support for objects of class SimpleXMLElement in Fluid.

this is the xml file i currently work with: http://snipt.org/vqgh9

i use this command to interprete the XML file to an object:

--- code ---
$object = simplexml_load_file($xmlFile);
--- /quote ---

i assign the object in a controller action to the view:

--- code ---
$this->view->assign('object', $object);
--- /code---





(1) if i debug the whole object (SimpleXMLElement) in my fluid template...

--- code ---
<f:debug>{object}</f:debug>
--- /code ---

...i get this returned:

--- quote ---
Extbase Variable Dump
'  ' (12 chars)
--- /quote ---

this is not what i expected. i expected to get back the whole object.





(2) if i debug this attribute (string) of the object in my fluid template...

--- code ---
<f:debug>{object.metadata.contact.person.email1}</f:debug>
--- /code ---

...i get this returned:

--- quote ---
Extbase Variable Dump
' internetwetter at zamg.ac.at  ' (30 chars)
--- /quote ---

this is what i expected.





(3) if i debug this attribute (array) of the object in my fluid template...

--- code ---
<f:debug>{object.station}</f:debug>
--- /code ---

...i get this returned:

--- quote ---
Extbase Variable Dump
'  ' (10 chars)
--- /quote ---

this is not what i expected. i expected to get back the whole array.





(4) if i debug this attribute (array) of the object in my fluid template...

--- code ---
<f:debug>{object.metadata.contact.person. at attributes.name}</f:debug>
--- /code ---

...i get this returned:

--- quote ---
Extbase Variable Dump
' {object.metadata.contact.person. at attributes.name}  ' (54 chars)
--- /quote ---

this is not what i expected. i expected to get back string "GENERAL 
CONTACT".




(5) if i debug this attribute (array) of the object in my fluid template...

--- code ---
<f:debug>{object.station.0.prognose.datum.0.time.0.param.1}</f:debug>
--- /code ---

...i get this returned:

--- quote ---
Extbase Variable Dump
'  ' (5 chars)
--- /quote ---

this is not what i expected. i expected to get back the string "Nordwest".




what do you think? is the support for support for objects of class 
SimpleXMLElement a missing feature (that should be added), or am i doing 
something wrong?

kind regards

roland


More information about the TYPO3-project-typo3v4mvc mailing list