Javascript 如何使用jTemplates'${#if}条件中的P参数

Javascript 如何使用jTemplates'${#if}条件中的P参数,javascript,jquery,jtemplates,Javascript,Jquery,Jtemplates,是否可以在{if}条件内使用jTemplates的$p.imagesPerRow参数 这给我带来了“未捕获的12”例外 {#foreach $T as record} {#if $T.record$index % {$P.imagesPerRow} == 0} </tr> <tr> {#/if} <td class='image-preview-cell' style='width: {$P.cellWidth

是否可以在
{if}
条件内使用jTemplates的
$p.imagesPerRow
参数

这给我带来了“未捕获的12”例外

{#foreach $T as record}
    {#if $T.record$index % {$P.imagesPerRow} == 0}
        </tr>
        <tr>
    {#/if}
    <td class='image-preview-cell' style='width: {$P.cellWidth}; height: {$P.cellHeight}'>
    <img src='{$T.record.url}' title='{$T.record.title}' alt='{$T.record.title}'/>
</td> 
{#/for}
{#foreach$T作为记录}
{#如果$T.record$index%{$P.imagesPerRow}==0}
{#/if}
{#/for}

我还没有测试过这一点,这只是一种预感,但请尝试更改这一行:

{#if $T.record$index % {$P.imagesPerRow} == 0}
为此:

{#if $T.record$index % $P.imagesPerRow == 0}