最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2016年03月19日 09:20:39   作者:phpsome  
這篇文章主要介紹了smarty學習筆記之常見代碼段用法,結(jié)合實例形式總結(jié)分析了Smarty常見代碼段的含義與使用方法,需要的朋友可以參考下

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

1、

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

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

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

{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}

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

3、

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

說明:輪回返回數(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服務器取得

該文件并顯示.

6、

{html_image file="../path/relative/to/currdir/pumpkin.jpg"
border="1" height="100" width="100" alt="圖片" href="1.html"}

說明:圖片

7、

{html_select_date}

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

{html_select_time}

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

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ù)學運算函數(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è)計有所幫助。

相關(guān)文章

最新評論

山阴县| 阿克苏市| 临沧市| 镶黄旗| 封开县| 财经| 紫金县| 浮梁县| 获嘉县| 科尔| 武宣县| 河东区| 吉林省| 巩义市| 德钦县| 炉霍县| 会宁县| 阜宁县| 梁山县| 台山市| 尼玛县| 新平| 彭水| 沿河| 建水县| 张掖市| 广宗县| 海兴县| 环江| 彭山县| 佳木斯市| 六安市| 大厂| 马山县| 枣庄市| 苏尼特右旗| 嘉兴市| 河津市| 宜丰县| 班戈县| 庆阳市|