Validation method for determining the last record of the Volist loop in a thinkphp template _php tutorial

Source: Internet
Author: User
For a friend who has done PHP development with smarty, it should be known that the Smarty template determines whether the Foreach loop is the last one that can be used for $ Smarty.foreach.name.last to determine if the loop is in the last record, the loops that are common in the thinkphp template are volist, but the attributes of the volist are not directly judged by the properties of the last record. So how do you judge in thinkphp? The following code can implement the last record in thinkphp volist.
Examples of code are as follows, and readers can experience them on their own.

 
  
  
   
  • Class= "Last" > Scripting House

    The $i in the code snippet above is a count variable in the Volist loop, and the default name is $i, so you can use it directly without declaring it.

    http://www.bkjia.com/PHPjc/824687.html www.bkjia.com true http://www.bkjia.com/PHPjc/824687.html techarticle for a friend who has done PHP development with smarty, it should be known that the Smarty template determines whether the Foreach loop is the last one that can be used to determine if the loop is $smarty.foreach.name.last ...

  • 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.