Smarty section Nested loop usage example, smartysection
The example in this article describes the section nested loop usages of smarty. Share to everyone for your reference, as follows:
{section name= "SEC1" loop= $typeList}
{$typeList [Sec1].typename} |
|
{section name= "sec2" loop= $typeList [Sec1].shop}
|
{$typeList [Sec1].shop[sec2].name} |
Quantity: {$typeList [Sec1].shop[sec2].num} |
Price: {$typeList [sec1].shop[sec2].price} white gold |
| {/section}
{/section}
SEC1 's $typeList [sec1].shop as a sec2 loop
You can fetch the contents of the array in the shop.
More interested in smarty related content readers can view the topic: "Smarty Template Primer Basic Tutorial", "PHP Template Technology Summary", "PHP based on PDO Operation Database Skills summary", "PHP operation and operator Usage Summary", "PHP Network Programming Skills Summary", " PHP Basic Grammar Introductory tutorial, PHP Object-oriented Programming primer, PHP string usage Summary, PHP+MYSQL database Operations Primer and PHP Common database operations Tips Summary
It is hoped that this article will be helpful to everyone based on smarty template PHP program design.
http://www.bkjia.com/PHPjc/1133056.html www.bkjia.com true http://www.bkjia.com/PHPjc/1133056.html techarticle smarty section Nested loop Usage example, smartysection This article describes the section nested loop usages of smarty. Share to everyone for your reference, as follows: {section name= "s ...