开发者

Reading xml in Smarty template

开发者 https://www.devze.com 2023-03-09 18:41 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消