This article describes how to solve the newline BUG of volist tag mod in Thinkphp to control certain records. It involves modifying the order of statements executed by tags, which is of great practical value, for more information about how to solve the newline BUG in Thinkphp, see the examples in this article. Share it with you for your reference. The specific method is as follows:
I. BUG description:
It exists in thinkphp 2.0
The Mod attribute is also used to control the line feed of a certain record, for example:
The Code is as follows:
{$ Vo. name}
The text is excerpted from the official manual.
The actual execution result is:
4 records in the first row (one missing)
The second and subsequent rows are five records.
Ii. Modification comments:
ThinkPHP \ Lib \ Think \ Template \ TagLib \ TagLibCx. class. php
Line 107 and line 108 are interchangeable.
Original code:
The Code is as follows:
$ ParseStr. = '+ + $'. $ key .';';
$ ParseStr. = '$ mod = ($'. $ key. '%'. $ mod. ')?> ';
After modification:
The Code is as follows:
$ ParseStr. = '$ mod = ($'. $ key. '%'. $ mod .');';
$ ParseStr. = '+ + $'. $ key. '?> ';
I hope this article will help you with ThinkPHP framework programming.