Convert field to php array
In my installation I use "catalogmultitextwizardfield" module.
And in my Catalog module it works fine:
http://img715.imageshack.us/img715/9769/scrspec.jpg
Uploaded with ImageShack.us
but in my template this module generates me strange code
If I use this:
Code:
<?php echo $entry['data']['myField']['value']; ?>
give me the data embeded into table. But I don't want table.
If I use this:
Code:
<?php echo $entry['data']['myField']['raw']; ?>
code looks like this:
Code:
<data>
<row>
<entry>Zakres pracy 900/1800 MHz</entry>
</row>
<row>
<entry>Radiacja H-360°, V -30°</entry>
</row>
<row>
<entry>Polaryzacja pionowa</entry>
</row>
<row>
<entry>Zysk 2dB</entry>
</row>
<row>
<entry>VSWR </entry>
</row>
<row>
<entry>Impedancja 50 ohm</entry>
</row>
<row>
<entry>Moc max. 10 W</entry>
</row>
</data>
It's seems like xml or something like this.
How to convert this code into php array?
Re: Convert field to php array
I solved this. Maybe it's not beautiful but it's works:
Code:
<?php $xml = simplexml_load_string($entry['data']['myField']['raw']); ?>
<ul>
<?php foreach ($xml->row as $col): ?>
<?php foreach ($col->entry as $spec): ?>
[*]<?php echo $spec; ?>
<?php endforeach; ?>
<?php endforeach; ?>[/list]
Re: Convert field to php array
Each catalog field integrator includes a rendered, which can be changed if you like. Not sure why it's XML as the raw rendered is usually from the database.