Get the App
SLTechnology News&Howtos  ›  Development  › 

How to determine the attribute of the last record of the volist loop in the ThinkPHP template

Shulou Source: shulou.com Published: 2022-06-03 18:12:43 10月03日 Update

This article mainly explains "how to judge the attributes of the last record of volist loop in ThinkPHP template". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it. Study and learn "how to judge the attributes of the last record of volist loop in ThinkPHP template" together!

For friends who have used smarty to develop php, you should all know that in smarty template to determine whether foreach loop is the last one can use $smarty.foreach.name.last to determine whether the loop to the last record, in thinkphp template common loop is volist, but volist's various attributes do not directly determine the attributes of the last record, so how to determine in thinkphp? The following code implements volist breaking the last record in ThinkPHP.

The code is as follows, and the reader can understand it for himself.

The $i in the above code snippet is a count variable in the volist loop. The default name is $i, so it can be used directly without declaration.

Thank you for reading, the above is "ThinkPHP template how to determine the attributes of the last record of the volist loop" content, after the study of this article, I believe that everyone on the ThinkPHP template how to determine the attributes of the last record of the volist loop This problem has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Loops attributes templates code learning content that is no variables names common ideas situations articles more friends knowledge knowledge points articles readers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Xiaomi macOS Linux OPPO Reno