天空是藍色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
          數據加載中……
          smarty循環array-map顯示
          y.html 模板文件
                              <ul>
                              {{{section name=item loop=$menu_item}}}
                                  
          <li><href="{{{$menu_item[item][0]}}}">{{{$menu_item[item][1]}}}</a></li>
                              {{{/section}}}
                              
                                  
          <!--
                                  格式
                                       <li><a href="#">Index</a></li>
                                      <li><a href="#">Selected Content</a></li>
                                      <li><a href="#">Guestbook</a></li>
                                      <li><a href="#">Toggle Sidebar</a></li>
                                      <li><a href="#">Login</a></li>
                                  
          -->
                              
          </ul>

          head.php
          <?php

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

          $smarty = new Smarty;

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

          $smarty->left_delimiter = "{{{"
          $smarty->right_delimiter = "}}}"

          $site_title ="中文";
          ?>
          ini.php
          <?php
          define('SITE_TITLE','中文');
          define('SITE_LINK','');
          define('AUTHER','bluesky');
          define('BABY','');
          define('WATCH','');
          define('BLOG_TITLE','HELLOWORLD,BLOG');
          define('BLOG_INDEX_LINK','HTTP://localhost:88/yy/xy.php');
          ?>

          xy.php
          <?php

          //echo dirname(__FILE__);

          require 'head.php';
          require 'ini.php';

          $page = 'y.html';
          define('PAGE_TITLE','中國');
          $smarty->assign('site_title',SITE_TITLE);
          $smarty->assign('page_title',PAGE_TITLE);
          $smarty->assign('blog_title',BLOG_TITLE);
          $smarty->assign('blog_index_link',BLOG_INDEX_LINK);

          $href = array();
          $value = array();
          $href[1= 'index.php'$value[1= '首頁';
          $href[2= 'guest.php'$value[2= '留言本';
          $href[3= 'about.php'$value[3= '關于';
          $href[4= 'link.php';  $value[4= '鏈接';


          $map = array_map(null,$href,$value);

          for($index=0;$index<count($c);$index++){
              
          //echo "<a href=".$c[$index][0].">";
              //echo $c[$index][1]."</a><br/>";

          }

          //return;
          $smarty->assign('menu_item',$map);

          $smarty->display($page);
          ?>

          posted on 2005-12-30 14:22 bluesky 閱讀(1670) 評論(0)  編輯  收藏 所屬分類: PHP

          主站蜘蛛池模板: 麻阳| 江城| 上饶县| 措勤县| 西畴县| 扶余县| 延庆县| 涟源市| 南皮县| 浮梁县| 南岸区| 临夏县| 吴堡县| 时尚| 兴和县| 辉县市| 白银市| 霍州市| 五常市| 佛学| 临洮县| 惠东县| 怀集县| 从化市| 石狮市| 友谊县| 察哈| 青海省| 屯昌县| 宜丰县| 科技| 内乡县| 德钦县| 石城县| 丹寨县| 涞水县| 富顺县| 青河县| 山东省| 仙桃市| 仁怀市|