国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

smarty學(xué)習(xí)筆記之常見代碼段用法總結(jié)

2024-05-04 23:44:08
字體:
供稿:網(wǎng)友
這篇文章主要介紹了smarty學(xué)習(xí)筆記之常見代碼段用法,結(jié)合實(shí)例形式總結(jié)分析了Smarty常見代碼段的含義與使用方法,需要的朋友可以參考下
 

本文實(shí)例講述了smarty常見代碼段。分享給大家供大家參考,具體如下:

1、

<select >  {html_options values=$cust_ids selected=$customer_id output=$cust_names}</select>

說明:生成下拉菜單。values=一個數(shù)組,數(shù)組元素為列表值 selected=一個值,這個是默認(rèn)的列

表值 output=一個數(shù)組,數(shù)組元素為顯示的列表值

{html_checkboxes values=$cust_ids checked=$customer_id output=$cust_names separator="<br/>"}

說明:復(fù)選框。同上;separator="<br />"指以<br />分隔每個復(fù)選按鈕的字符串

{html_radios values=$cust_ids checked=$customer_idoutput=$cust_names separator="<br/>"}

說明:單選按鈕

2、

{counter start=0 skip=2 print=ture}

說明:計(jì)數(shù)器,其后使用時(shí),以0 開始,每次增加 2 。

3、

{section loop=$data}  <tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">  <td>{$data[rows]}</td>  </tr>{/section}

說明:輪回返回?cái)?shù)組元素(或一個數(shù)列)值

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 用于從本地文件系統(tǒng)、HTTP或FTP上取得文件并顯示文件的內(nèi)容. 如果文件名稱 

以"http://"開頭,將取得該網(wǎng)站頁面并顯示. 如果文件名稱以"ftp://"開頭,將從ftp服務(wù)器取得

該文件并顯示.

6、

{html_image file="../path/relative/to/currdir/pumpkin.jpg"border="1" height="100" width="100" style="margin: 0px; padding: 0px; line-height: 25.2px; width: 660px; overflow: hidden; clear: both;">		
{html_select_date}

說明:創(chuàng)建日期下拉菜單. 它可以顯示任意年月日

{html_select_time}

說明:用于創(chuàng)建時(shí)間下拉菜單. 它可以顯示任意時(shí)分秒

8、

{html_table loop=$data cols=4 table_attr='border="0"'tr_attr=$tr td_attr=$td}

說明:以$data數(shù)組元素形成一個4列的表。table_attl為表格屬性,tr_attr為行屬性,td_attr

為列屬性

9、

{math equation="x + y" x=$height y=$width}

說明:數(shù)學(xué)運(yùn)算函數(shù)

10、

{mailto address="me@domain.com" text="send me some mail"}

說明:生成電子郵件鏈接

11、

{popup}

說明:創(chuàng)建javascript彈出窗口,使用前必須先調(diào)用 popup_init 函數(shù)

希望本文所述對大家基于smarty模板的PHP程序設(shè)計(jì)有所幫助。



發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 隆回县| 包头市| 阿鲁科尔沁旗| 长葛市| 呼玛县| 富锦市| 昌吉市| 慈溪市| 江永县| 故城县| 慈溪市| 兴安盟| 黄大仙区| 阳东县| 遵义市| 奉新县| 柯坪县| 兖州市| 靖远县| 会昌县| 嵊泗县| 安徽省| 阿图什市| 新野县| 揭西县| 都江堰市| 长春市| 徐水县| 延长县| 溧水县| 白水县| 叙永县| 肃宁县| 衡南县| 察雅县| 改则县| 常宁市| 涿州市| 工布江达县| 泰兴市| 容城县|