天空是藍色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執(zhí)行exe #helloworld //運行exe
          數(shù)據(jù)加載中……
          {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 閱讀(2055) 評論(1)  編輯  收藏 所屬分類: 記事本

          評論

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

          dfasdfasdfasdfasdf
            回復(fù)  更多評論    
          主站蜘蛛池模板: 于田县| 黄梅县| 邹平县| 紫阳县| 华亭县| 谢通门县| 洱源县| 平原县| 宜良县| 寿宁县| 罗江县| 九江市| 山东省| 昌江| 康保县| 溧水县| 正阳县| 大竹县| 连州市| 丹江口市| 全州县| 罗山县| 荥阳市| 姜堰市| 大洼县| 邢台县| 丹凤县| 怀集县| 长岭县| 延庆县| 忻城县| 赤城县| 成武县| 平陆县| 茌平县| 尼玛县| 密云县| 泌阳县| 六枝特区| 武城县| 鹤壁市|