thinkphp volist Tag mod controls certain recorded newline bug resolution, thinkphpvolist_php tutorial

Source: Internet
Author: User

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

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