天空是藍色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
          數據加載中……
          {if $smarty.section.outer.index is odd by 2}
          test.tpl
          <table border=1>
          {section name
          =outer loop=$FirstName}
          {if $smarty.section.outer.index is odd by 
          3}
              <tr bgcolor
          ="#EFEFEF"><td>
               {$smarty.section.outer.index}-{$smarty.section.outer.rownum} . {$FirstName
          [outer]} {$LastName[outer]}
              </td></tr>
          {else}
              <tr bgcolor
          ="#FFFFFFF"><td>
              {$smarty.section.outer.index}-{$smarty.section.outer.rownum} * {$FirstName
          [outer]} {$LastName[outer]}
              </td></tr>
          {/if}
          {sectionelse}
              none
          {/section}

          </table>
          test.php
          <?php

          require 'lib/Smarty-
          2.6.11/libs/Smarty.class.php';

          $smarty 
          = new Smarty;

          //$smarty->compile_check 
          = true;
          //$smarty->debugging = true;

          //$smarty->assign(
          "hello","byby");
          $smarty->assign("FirstName",array("John","Mary","James","Henry","Tom","Hello"));

          $smarty->display('test.tpl')
          ;

          ?>


          {if $smarty.section.outer.index is odd by 1}
          0 -1 * John
          1 -2 . Mary
          2 -3 * James
          3 -4 . Henry
          4 -5 * Tom
          5 -6 . Hello

          {if $smarty.section.outer.index is odd by 2}
          0 -1 * John
          1 -2 * Mary
          2 -3 . James
          3 -4 . Henry
          4 -5 * Tom
          5 -6 * Hello

          {if $smarty.section.outer.index is odd by 3}
          0 -1 * John
          1 -2 * Mary
          2 -3 * James
          3 -4 . Henry
          4 -5 . Tom
          5 -6 . Hello

          posted on 2005-12-27 16:21 bluesky 閱讀(2064) 評論(1)  編輯  收藏 所屬分類: 記事本

          評論

          # re: {if $smarty.section.outer.index is odd by 2} 2007-01-05 18:16 sdfadsf

          dfasdfasdfasdfasdf
            回復  更多評論    
          主站蜘蛛池模板: 台山市| 武定县| 思南县| 德江县| 富宁县| 瑞安市| 图们市| 万山特区| 当雄县| 射洪县| 岳阳县| 曲沃县| 安丘市| 新宁县| 甘孜| 宜丰县| 井研县| 榆中县| 河北区| 永年县| 海安县| 香河县| 壶关县| 且末县| 保山市| 安远县| 兴山县| 开封市| 翁源县| 赞皇县| 肇庆市| 思南县| 繁峙县| 通河县| 五华县| 平罗县| 黑山县| 玉环县| 河南省| 琼结县| 疏勒县|