天空是藍色的

          做好軟件為中國 #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 閱讀(1666) 評論(0)  編輯  收藏 所屬分類: PHP

          主站蜘蛛池模板: 陆良县| 洪雅县| 崇礼县| 成安县| 新闻| 武陟县| 西畴县| 根河市| 云浮市| 甘谷县| 双辽市| 永吉县| 嫩江县| 南京市| 肥东县| 柘城县| 贺州市| 饶平县| 邓州市| 泰和县| 登封市| 淮南市| 前郭尔| 长白| 灵川县| 杨浦区| 图木舒克市| 普陀区| 湟源县| 连江县| 绥江县| 青田县| 定边县| 佳木斯市| 永德县| 兴和县| 南康市| 射洪县| 察雅县| 晋中市| 辽源市|