$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" } }