首页 > 建站教程 > CMS教程 > phpcms >  PHPCMS学习第十一天:PHPCMS条件循环IF判断正文

PHPCMS学习第十一天:PHPCMS条件循环IF判断

PHPCMS条件循环IF判断
{pc:content action="lists" moreinfo="1" catid="$catid" num="3" order="id DESC" page="$page"}
         {loop $data $i $r}
                {php $num++;}
              <div class="{if $num == 1}al1{elseif $num == 2}al2{else}al3{/if}">
                      <div class="tb fl"><img src="{TP}images/tb-3.png" /></div>
                     <div class="cp fl"><a href="{$r[url]}"><img  alt="{$r[title]}" width="158" height="112" src="{thumb($r[thumb],158,112,1)}"></a></div>
                      <div class="tp fl"><a href="{$r[url]}">{$r[title]}</a><div class="des">{$r['description']}</div></div>
              </div>
          {/loop}
      {/pc}
PHPCMS里面 if判断标签注意 elseif的写法  {if $num == 1}al1{elseif $num == 2}al2{else}al3{/if}
在PHPCMS模版里面  js,jquery一定要写规范!  结尾一定要加分号