smarty学习笔记之实际小例
2009-02-18 20:48
309 查看
1、<select >
{html_options values=$cust_ids selected=$customer_id output=$cust_names}
</select>
说明:生成下拉菜单。values=一个数组,数组元素为列表值 selected=一个值,这个是默认的列
表值 output=一个数组,数组元素为显示的列表值
{html_checkboxes values=$cust_ids checked=$customer_id output=$cust_names separator="<br
/>"}
说明:复选框。同上;separator="<br />"指以<br />分隔每个复选按钮的字符串
{html_radios values=$cust_ids checked=$customer_id output=$cust_names separator="<br
/>"}
说明:单选按钮
2、{counter start=0 skip=2 print=ture}
说明:计数器,其后使用时,以0 开始,每次增加 2 。
3、{section loop=$data}
<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
<td>{$data[rows]}</td>
</tr>
{/section}
说明:轮回返回数组元素(或一个数列)值
4、{assign var="name" value="Bob"}
The value of $name is {$name}.//The value of $name is Bob。
说明:赋值
5、{fetch file="http://www.myweather.com/68502/" assign="weather"}
说明:fetch 用于从本地文件系统、HTTP或FTP上取得文件并显示文件的内容. 如果文件名称
以"http://"开头,将取得该网站页面并显示. 如果文件名称以"ftp://"开头,将从ftp服务器取得
该文件并显示.
6、{html_image file="../path/relative/to/currdir/pumpkin.jpg" border="1" height="100"
width="100" alt="图片" href="1.html"}
说明:图片
7、{html_select_date}
说明:创建日期下拉菜单. 它可以显示任意年月日
{html_select_time}
说明:用于创建时间下拉菜单. 它可以显示任意时分秒
.
8、{html_table loop=$data cols=4 table_attr='border="0"' tr_attr=$tr td_attr=$td}
说明:以$data数组元素形成一个4列的表。table_attl为表格属性,tr_attr为行属性,td_attr
为列属性
9、{math equation="x + y" x=$height y=$width}
说明:数学运算函数
10、{mailto address="me@domain.com" text="send me some mail"}
说明:生成电子邮件链接
11、{popup}
说明:创建javascript弹出窗口,使用前必须先调用 popup_init 函数
{html_options values=$cust_ids selected=$customer_id output=$cust_names}
</select>
说明:生成下拉菜单。values=一个数组,数组元素为列表值 selected=一个值,这个是默认的列
表值 output=一个数组,数组元素为显示的列表值
{html_checkboxes values=$cust_ids checked=$customer_id output=$cust_names separator="<br
/>"}
说明:复选框。同上;separator="<br />"指以<br />分隔每个复选按钮的字符串
{html_radios values=$cust_ids checked=$customer_id output=$cust_names separator="<br
/>"}
说明:单选按钮
2、{counter start=0 skip=2 print=ture}
说明:计数器,其后使用时,以0 开始,每次增加 2 。
3、{section loop=$data}
<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
<td>{$data[rows]}</td>
</tr>
{/section}
说明:轮回返回数组元素(或一个数列)值
4、{assign var="name" value="Bob"}
The value of $name is {$name}.//The value of $name is Bob。
说明:赋值
5、{fetch file="http://www.myweather.com/68502/" assign="weather"}
说明:fetch 用于从本地文件系统、HTTP或FTP上取得文件并显示文件的内容. 如果文件名称
以"http://"开头,将取得该网站页面并显示. 如果文件名称以"ftp://"开头,将从ftp服务器取得
该文件并显示.
6、{html_image file="../path/relative/to/currdir/pumpkin.jpg" border="1" height="100"
width="100" alt="图片" href="1.html"}
说明:图片
7、{html_select_date}
说明:创建日期下拉菜单. 它可以显示任意年月日
{html_select_time}
说明:用于创建时间下拉菜单. 它可以显示任意时分秒
.
8、{html_table loop=$data cols=4 table_attr='border="0"' tr_attr=$tr td_attr=$td}
说明:以$data数组元素形成一个4列的表。table_attl为表格属性,tr_attr为行属性,td_attr
为列属性
9、{math equation="x + y" x=$height y=$width}
说明:数学运算函数
10、{mailto address="me@domain.com" text="send me some mail"}
说明:生成电子邮件链接
11、{popup}
说明:创建javascript弹出窗口,使用前必须先调用 popup_init 函数
相关文章推荐
- C++学习笔记 5th —— 万能流程控制if语句 续篇:扩展与实际应用
- Smarty模板学习笔记
- smarty学习笔记一
- Smarty 学习笔记五 模版编译
- 学习笔记——java中重写和重载的在实际开发的应用场景
- linux系统学习笔记:无死角理解保存的设置用户ID,设置用户ID位,有效用户ID,实际用户ID
- java泛型的学习笔记[2]—实际使用
- sqlserver -- 学习笔记(八)体验charindex、stuff 和 for xml path在实际问题中的应用及几个问题的探讨
- 函数传参和实际应用—JS学习笔记2015-6-5(第49天)
- 【记录】正则表达式学习第3天(正则学习笔记),又解决了个实际问题。
- SDB文件注册实际流程(学习笔记)
- 算法学习笔记——利用栈解决实际问题- part 2
- php学习笔记(三十八)smarty中的内建函数的使用
- php学习笔记(四十)smarty3的模板继承新特性
- Smarty模板学习笔记之Smarty简介
- 【C++】学习小笔记系列-1-new和delete的实际过程。
- Smarty 学习笔记网址,转
- [MFC学习笔记]--网络编程实际操作编写服务器端
- Spring学习笔记——Spring如何装配各种类型的属性以及实际应用
- Smarty 学习笔记六 缓存