Reading xml in Smarty template
In my smarty template, I have this assigning...
{assign var="feeds" value="-RSS FEED LINK-"}
How do I parse the variable $feeds
and print the values in each tag - in the smar开发者_开发知识库ty template?
This should load the XML into an Object and print it:
{assign var="feeds" value="-RSS FEED LINK-"}
{$feeds|@simplexml_load_string|@print_r}
But loke Paul said in the comments, I would suggest to do the assignment in PHP and then use smarty to just walk the object.
精彩评论