I wrote a script which exports an contao-catalog item as PDF if the user saves the entry in the backend-view.
my problem is, that in the templates there are codes like this, if I print out i.e. the variable $entry['data']['link_img']['ref']
.:
a:3:{i:0;s:2:"14";i:1;s:2:"15";i:2;s:2:"13";}
(a serialized Array, which does not match the foreach specifications)
The php code looks like this:
<?php foreach ($entry['data']['link_img']['ref'] as $link_img):?>
<? print($link_img); ?>
<a href="werke-detail/items/<?php echo $link_img['alias']; ?>.html">
<?php echo $link_img['title']; ?> </a><br />
<?php endforeach; ?>
when contao parses the template, this works, if I get the data, it doesn't. Is there a function from contao which I can use, to decode this, to get my foreach to work?
UPDATE
The big question is: Where does Contao do it's magic in the template-engine and how can I do the same?
Thanks
unserialize()
should be the ticket.alias
in it ....