天空是藍色的

          做好軟件為中國 #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 閱讀(2057) 評論(1)  編輯  收藏 所屬分類: 記事本

          評論

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

          dfasdfasdfasdfasdf
            回復  更多評論    
          主站蜘蛛池模板: 富民县| 江津市| 噶尔县| 钟祥市| 宜川县| 凤阳县| 尉犁县| 得荣县| 康保县| 峡江县| 大港区| 温州市| 安丘市| 新宁县| 措美县| 都安| 海淀区| 浑源县| 交城县| 乌拉特中旗| 深水埗区| 布尔津县| 于田县| 改则县| 濮阳县| 集贤县| 景泰县| 田阳县| 正蓝旗| 安宁市| 巴林左旗| 云龙县| 丹阳市| 遵义市| 克东县| 光泽县| 佛冈县| 长海县| 武平县| 沙洋县| 榆林市|