$list 原始數組范例
array(16) { [0]=> array(17) { ["aid"]=> string(4) "1749" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(12) "模板概述" ["summary"]=> string(216) "一、模板基礎結構二、模板范例 1、index.htm 2、header.htm 3、footer.htm 4、list_xxx.htm 5、view_xxx.htm三、數據概念從模板的數據設計角度,我們 ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(1) "7" ["dateline"]=> string(10) "1442975454" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(58) "https://pic.tdy.picdns.com/1/news/201509/22/162122M99i4.jpg" ["ispic"]=> int(1) ["picsuffix"]=> string(3) "jpg" } [1]=> array(18) { ["aid"]=> string(4) "1785" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(26) "遍歷數組方法 foreach" ["cover"]=> string(0) "" ["summary"]=> string(336) "foreach用來遍歷一個數組,以便模板調用數組中的值,foreach 是成對出現的。1、將數組的值賦值給形參 $v{foreach $list as $v} <li>文章標題是:{$v['title']}</li> {/foreach}2、將數組的鍵賦值給形參 $k,將數組的值賦值給 ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(1) "2" ["dateline"]=> string(10) "1442975343" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [2]=> array(18) { ["aid"]=> string(4) "1784" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(27) "文章內容變量 $article" ["cover"]=> string(0) "" ["summary"]=> string(225) "文章內容變量 $article 僅在文章內容頁可調用,可用字段如下: [\"aid\"] //id [\"title\"] //標題 [\"summary\"] //簡介 &n" ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(1) "2" ["dateline"]=> string(10) "1442974221" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [3]=> array(18) { ["aid"]=> string(4) "1783" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(16) "全局變量 $_Y" ["cover"]=> string(0) "" ["summary"]=> string(358) "$_Y 是一個數組,里面存儲著網站的基本信息和狀態記錄,此外$_Y 也會被當成一個臨時存儲器,一些臨時變量也會存儲在$_Y里方便全局調用。其基本數組結構請查看:$_Y 原始數組范例 。$_Y常用變量:/***網站基本信息***/ $_Y["uid"] & ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(1) "2" ["dateline"]=> string(10) "1442972024" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [4]=> array(18) { ["aid"]=> string(4) "1782" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(21) "$_Y原始數組范例" ["cover"]=> string(0) "" ["summary"]=> string(267) "$_Y 原始數組范例array(53) { ["time"]=> int(1442969220) ["defaulttempvision"]=> string(1) "1" ["default_path"]=> string(33)&n" ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(1) "3" ["dateline"]=> string(10) "1442969326" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [5]=> array(18) { ["aid"]=> string(3) "542" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(37) "[模板范例] 首頁模板 index.htm" ["cover"]=> string(0) "" ["summary"]=> string(252) "首頁模板范例{include file=$_Y[\'template\'][\'header\']} <p>這是網站首頁<p> {include file=$_Y[\'template\'][\'footer\']}說明:{include file=$_Y[\'template\'][\'header\']} 調用網站頭部模板(header.htm){include f ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "66" ["dateline"]=> string(10) "1442910881" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [6]=> array(18) { ["aid"]=> string(3) "540" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(44) "[模板范例] 公共頭部模板 header.htm" ["cover"]=> string(0) "" ["summary"]=> string(279) "公共頭部模板范例{include file=$_Y['template']['global_header']} <!--head--> <div class="head"> ... </div> <div class="wp">說明:1、{include file=$_Y['tem" ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "61" ["dateline"]=> string(10) "1442910719" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [7]=> array(18) { ["aid"]=> string(3) "541" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(44) "[模板范例] 公共底部模板 footer.htm" ["cover"]=> string(0) "" ["summary"]=> string(297) "公共底部模板范例</div> <div class=\"footer\"> ... </footer> {include file=$_Y[\'template\'][\'global_footer\']}說明:1、{include file=$_Y[\'template\'][\'global_footer\']} 是調用系統底部的模板 一般情況下必須。2、第一行中的 ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "55" ["dateline"]=> string(10) "1442910694" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [8]=> array(18) { ["aid"]=> string(3) "563" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(30) "[模板范例] 文章內容頁" ["cover"]=> string(0) "" ["summary"]=> string(217) "文章內容頁模板范例{include file=$_Y[\'template\'][\'header\']} <div class=\"cl\"> <!--關于/資訊/網絡--> <div class=\"left\"> <d" ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "76" ["dateline"]=> string(10) "1442903484" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [9]=> array(17) { ["aid"]=> string(3) "572" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(12) "常用方法" ["summary"]=> string(337) "{nocache}作用:禁止緩存語法:{nocache}<htmlcode>{/nocache} //被{nocache}標簽包圍的地方不進行緩存 需要使用{nocache}包圍的地方有:需要用戶登陸后可操作的地方,如發布文章按鈕 和 編輯刪除文章按鈕等{foreach}作用:遍歷數組語法:<ul> {foreach $list ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(3) "153" ["dateline"]=> string(10) "1442490852" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(58) "https://pic.tdy.picdns.com/1/news/201509/17/195341RwPoz.jpg" ["ispic"]=> int(1) ["picsuffix"]=> string(3) "jpg" } [10]=> array(18) { ["aid"]=> string(3) "562" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(27) "[模板] 內容列表模板" ["cover"]=> string(0) "" ["summary"]=> string(214) "[模板] 內容列表模板范例{include file=$_Y[\'template\'][\'header\']} <div class=\"cl\"> <!--左邊欄導航--> <div class=\"left\"> " ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "94" ["dateline"]=> string(10) "1440580258" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [11]=> array(18) { ["aid"]=> string(3) "672" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(16) "常用 js 方法" ["cover"]=> string(0) "" ["summary"]=> string(312) "注意:本文檔所列 js 方法或函數均已內置到系統內部。因此使用的時候 直接調用即可。無需再次引入源代碼。rolling 查看源代碼/*滾動效果(向上或向左) li //[可選] 子元素選擇器, 默認值:\'.li\'; direction //[可選] 方向&nb ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "66" ["dateline"]=> string(10) "1440195614" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [12]=> array(18) { ["aid"]=> string(3) "571" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(30) "[模板] 關于我們列表頁" ["cover"]=> string(0) "" ["summary"]=> string(217) "[模板] 關于我們列表頁模板范例{include file=$_Y[\'template\'][\'header\']} <div class=\"w1188 mt25 cl\"> <div> {catbymod return=\"aboutcat\" mod=$_" ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "70" ["dateline"]=> string(10) "1439621301" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [13]=> array(18) { ["aid"]=> string(3) "534" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(18) "調用網站導航" ["cover"]=> string(0) "" ["summary"]=> string(223) "調用網站導航代碼范例<ul class=\\\"nav left cl\\\"> {if $_Y[\\\'nav\\\'][\\\'menu\\\']} {foreach $_Y[\\\'nav\\\'][\\\'menu\\\'] as $v} {if $v[\\\'level\\\'] == 1 && $v[\\\'" ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "92" ["dateline"]=> string(10) "1439547609" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [14]=> array(18) { ["aid"]=> string(3) "528" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(12) "常用變量" ["cover"]=> string(0) "" ["summary"]=> string(327) "以下列出的變量是模板制作過程中經常用到的,實際在在制作模板過程中如果對某個數組變量有疑惑的話可以使用{yun_dump val=$var}查看數據結構(注:$var 指的是要查看的變量)一、全局變量/*** *基本信息 *數據類型:字符串 ***/ $_Y[\'title\'] ..." ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(3) "116" ["dateline"]=> string(10) "1439537605" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } [15]=> array(18) { ["aid"]=> string(3) "570" ["catid"]=> string(3) "245" ["uid"]=> string(1) "1" ["title"]=> string(30) "[模板] 關于我們內容頁" ["cover"]=> string(0) "" ["summary"]=> string(202) "關于我們內容頁模板范例{include file=$_Y[\'template\'][\'header\']} <div class=\"w1188 mt25 cl\"> <div class=\"list_menu left\"> " ["from"]=> string(0) "" ["fromurl"]=> string(0) "" ["tourl"]=> string(0) "" ["author"]=> string(0) "" ["views"]=> string(2) "55" ["dateline"]=> string(10) "1439536875" ["del"]=> string(1) "0" ["tag"]=> string(1) "0" ["field"]=> NULL ["pic"]=> string(45) "https://pic.tdy.picdns.com//public/nophoto.jpg" ["ispic"]=> int(0) ["picsuffix"]=> string(3) "jpg" } }