Reply to smarty + XML

Your name:

Reply:


Posted by dc on 06/03/05 18:28

does smarty play nicely with objects created by PHP's simple xml?

---------------------- PHP
$xml = simplexml_load_file('assets/exList.xml');
$sm->assign("xml", $xml);

---------------------- XML
<exampleList>

<event>集中ゼミ</event>

<example>
<title>四角+テキスト</title>
<src>demo01.php</src>
<description>四角+テキスト。日本語対応</description>
</example>

etc

---------------------- smarty template:
{foreach from=$xml item=ex }
{$ex.event}
{$ex.title}
{/foreach}


but this only gives me the first letter of the item...

would the toplevel of the XML tree be passed into smarty?
eg exampleList/event

exampleList/example [0]? first item?


thanks for any help. would have thot this would be on the smarty site as
XML display with smarty would seem to be a major use...

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация