Smarty section Nested loop usage example, smartysection_php tutorial

Source: Internet
Author: User
Tags php template

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} {/section}
{$typeList [Sec1].shop[sec2].name}
Quantity: {$typeList [Sec1].shop[sec2].num}
Price: {$typeList [sec1].shop[sec2].price} white gold
{/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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.