|
Posted by Martin Braun on 04/28/05 19:29
Roger Thomas wrote:
> Hi,
> I parsed an XML file and pushed the results into an array. My question is, when I assign this array, $result, to Smarty, how do I reference it ?
>
> I have something like:
> {section name=feed loop=$news}
> <tr>
> <td>
> {$news[feed].COPYRIGHT}
> </td>
> </tr>
> {/section}
>
>
> How do I reference, say, the LINK under ITEMS ? Please advise.
should be {$result.ITEMS[0].LINK}. you can {section} through the ITEMS.
however, if you know you're going to access specific options like this,
I'd recommend restructuring $result in the PHP side (i.e. split it up
into smaller chunks).
If you're just parsing RSS feeds, perhaps you might want to check out
PEAR::XML_RSS.
cheers
martin
--
127.0.0.1 sweet 127.0.0.1
Please use my public PGP key: http://www.mbant.de/mbant-gpg-key
[Back to original message]
|