Home > Backend Development > PHP Tutorial > Thinkphp中volist标签中mod统制一定记录的换行BUG

Thinkphp中volist标签中mod统制一定记录的换行BUG

WBOY
Release: 2016-06-13 13:08:17
Original
923 people have browsed it

Thinkphp中volist标签中mod控制一定记录的换行BUG

BUG描述:
thinkphp 2.0 版本

Mod属性还用于控制一定记录的换行,例如:
volist name="list" id="vo" mod="5" >
{$vo.name}
eq name="mod" value="4">
eq>
volist>
---- 上述文字节选自官方手册 ----


实际的执行结果是
第一行 4个记录(缺少一个)
第二行及后面行才是 5个记录


修改意见:
ThinkPHP\Lib\Think\Template\TagLib\TagLibCx.class.php
line 107line 108 位置互换一下
代码
$parseStr .= '++$'.$key.';';
$parseStr .= '$mod = ($'.$key.' % '.$mod.' )?>';

修改后:
$parseStr .= '$mod = ($'.$key.' % '.$mod.' );';
$parseStr .= '++$'.$key.'?>';


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template