$list 原始數(shù)組范例
array(16) { [0]=> array(17) { ["aid"]=> string(4) "1749" ["catid"]=> string(3) "244" ["uid"]=> string(1) "1" ["title"]=> string(12) "模板概述" ["summary"]=> string(216) "一、模板基礎(chǔ)結(jié)構(gòu)二、模板范例 1、index.htm 2、header.htm 3、footer.htm 4、list_xxx.htm 5、view_xxx.htm三、數(shù)據(jù)概念從模板的數(shù)據(jù)設(shè)計(jì)角度,我們 ..." ["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) "遍歷數(shù)組方法 foreach" ["cover"]=> string(0) "" ["summary"]=> string(336) "foreach用來(lái)遍歷一個(gè)數(shù)組,以便模板調(diào)用數(shù)組中的值,foreach 是成對(duì)出現(xiàn)的。1、將數(shù)組的值賦值給形參 $v{foreach $list as $v} <li>文章標(biāo)題是:{$v['title']}</li> {/foreach}2、將數(shù)組的鍵賦值給形參 $k,將數(shù)組的值賦值給 ..." ["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) "文章內(nèi)容變量 $article" ["cover"]=> string(0) "" ["summary"]=> string(225) "文章內(nèi)容變量 $article 僅在文章內(nèi)容頁(yè)可調(diào)用,可用字段如下: [\"aid\"] //id [\"title\"] //標(biāo)題 [\"summary\"] //簡(jiǎn)介 &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 是一個(gè)數(shù)組,里面存儲(chǔ)著網(wǎng)站的基本信息和狀態(tài)記錄,此外$_Y 也會(huì)被當(dāng)成一個(gè)臨時(shí)存儲(chǔ)器,一些臨時(shí)變量也會(huì)存儲(chǔ)在$_Y里方便全局調(diào)用。其基本數(shù)組結(jié)構(gòu)請(qǐng)查看:$_Y 原始數(shù)組范例 。$_Y常用變量:/***網(wǎng)站基本信息***/ $_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原始數(shù)組范例" ["cover"]=> string(0) "" ["summary"]=> string(267) "$_Y 原始數(shù)組范例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) "[模板范例] 首頁(yè)模板 index.htm" ["cover"]=> string(0) "" ["summary"]=> string(252) "首頁(yè)模板范例{include file=$_Y[\'template\'][\'header\']} <p>這是網(wǎng)站首頁(yè)<p> {include file=$_Y[\'template\'][\'footer\']}說(shuō)明:{include file=$_Y[\'template\'][\'header\']} 調(diào)用網(wǎng)站頭部模板(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">說(shuō)明: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\']}說(shuō)明:1、{include file=$_Y[\'template\'][\'global_footer\']} 是調(diào)用系統(tǒng)底部的模板 一般情況下必須。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) "[模板范例] 文章內(nèi)容頁(yè)" ["cover"]=> string(0) "" ["summary"]=> string(217) "文章內(nèi)容頁(yè)模板范例{include file=$_Y[\'template\'][\'header\']} <div class=\"cl\"> <!--關(guān)于/資訊/網(wǎng)絡(luò)--> <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}作用:禁止緩存語(yǔ)法:{nocache}<htmlcode>{/nocache} //被{nocache}標(biāo)簽包圍的地方不進(jìn)行緩存 需要使用{nocache}包圍的地方有:需要用戶登陸后可操作的地方,如發(fā)布文章按鈕 和 編輯刪除文章按鈕等{foreach}作用:遍歷數(shù)組語(yǔ)法:<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) "[模板] 內(nèi)容列表模板" ["cover"]=> string(0) "" ["summary"]=> string(214) "[模板] 內(nèi)容列表模板范例{include file=$_Y[\'template\'][\'header\']} <div class=\"cl\"> <!--左邊欄導(dǎo)航--> <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 方法或函數(shù)均已內(nèi)置到系統(tǒng)內(nèi)部。因此使用的時(shí)候 直接調(diào)用即可。無(wú)需再次引入源代碼。rolling 查看源代碼/*滾動(dòng)效果(向上或向左) li //[可選] 子元素選擇器, 默認(rèn)值:\'.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) "[模板] 關(guān)于我們列表頁(yè)" ["cover"]=> string(0) "" ["summary"]=> string(217) "[模板] 關(guān)于我們列表頁(yè)模板范例{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) "調(diào)用網(wǎng)站導(dǎo)航" ["cover"]=> string(0) "" ["summary"]=> string(223) "調(diào)用網(wǎng)站導(dǎo)航代碼范例<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) "以下列出的變量是模板制作過(guò)程中經(jīng)常用到的,實(shí)際在在制作模板過(guò)程中如果對(duì)某個(gè)數(shù)組變量有疑惑的話可以使用{yun_dump val=$var}查看數(shù)據(jù)結(jié)構(gòu)(注:$var 指的是要查看的變量)一、全局變量/*** *基本信息 *數(shù)據(jù)類型:字符串 ***/ $_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) "[模板] 關(guān)于我們內(nèi)容頁(yè)" ["cover"]=> string(0) "" ["summary"]=> string(202) "關(guān)于我們內(nèi)容頁(yè)模板范例{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" } }