thinkphp volist Tag mod controls certain recorded newline bug resolution, Thinkphpvolist
In this paper, we describe the method of thinkphp the volist tag mod to control a certain record of a newline bug. Share to everyone for your reference. Here's how:
First, the description of the bug:
exists in thinkphp version 2.0
MoD properties are also used to control the line breaks for a certain record, for example:
Copy the Code code as follows:
{$vo. Name}
The above text is excerpted from the Official Handbook
The actual execution results are:
First row of 4 records (missing one)
The second and subsequent lines are 5 records.
Second, revise the opinion:
thinkphp\lib\think\template\taglib\taglibcx.class.php
Line 107 and line 108 position swap
Original code:
Copy the code as follows: $parseStr. = ' ++$ '. $key. '; ';
$parseStr. = ' $mod = ($ '. $key. '% '. $mod. ')? > ';
After modification:
Copy the code as follows: $parseStr. = ' $mod = ($ '. $key. '% '. $mod. '); ';
$parseStr. = ' ++$ '. $key. '? > ';
It is hoped that this article will be helpful to everyone's thinkphp framework design.
About Thinkphp's volist problem
You give it a try.
{$vo. Title}
The previous 5 is equivalent to 5 of your mod, and the next 4 equals 4 of your value, $count is the total number of statistics (using assign output in the method)
</if>
</volist>
The following method can also be tried ($count ibid.)
{$vo. Title}
</neq></eq>
</volist>
thinkphp volist label, how to set the self-increment serial number? Hope that the page can show that the single-and-one is not a database taken out
Please see Thinkphp's Official Document 8th Chapter Template engine 9th section volist tag, which mentions Volist's attribute has a key attribute in the original:
Key (optional): Loop key variable, the default value is I this is your self-increment number, and the default variable is $i, that is, within your volist tag, you can directly use $i
<{$i}>//Direct use $i</volist>
http://www.bkjia.com/PHPjc/906107.html www.bkjia.com true http://www.bkjia.com/PHPjc/906107.html techarticle thinkphp volist Tag mod control a certain record of a newline bug resolution, Thinkphpvolist This example describes the thinkphp volist tag mod control a certain record of a newline bug resolution. Share ...