中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

講解一下ECSHOP模版系統(tǒng)的顯示標簽

1970-01-01    來源:

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

ECSHOP模版系統(tǒng)中顯示標簽主要是轉換HTML代碼,該特性使得在表格中交替輸出顏色或輪轉使用數組中的值變得很容易,或者是根據給定的數據創(chuàng)建選項組,創(chuàng)建日期下拉菜單,它可以顯示任意年月日。亦或者是根據給定的數據創(chuàng)建單選按鈕組等,本文就給大家講解一下ECSHOP模版系統(tǒng)的顯示標簽。

cycle

屬性 類型 是否必須 缺省值 描述
name string No default 輪轉的名稱
values mixed ? N/A 待輪轉的值,可以是用逗號分隔的列表(請查看 delimiter 屬性)或一個包含多值的數組.
print boolean No true 是否輸出值
advance boolean No true 是否使用下一個值(為 false 時使用當前值)
delimiter string No 指出values 屬性中使用的分隔符,默認是逗號.
assign string No N/A 輸出值將被賦給模板變量的名稱

描述:

Cycle 用于輪轉使用一組值. 該特性使得在表格中交替輸出顏色或輪轉使用數組中的值變得很容易。

如果需要在模板中使用多個輪轉,需要給出唯一的 name 屬性.

用戶可以設置 print 屬性為 false 強制不輸出當前值. 該特性可以很方便地略過某個值.

advance 屬性用于重復使用某個值. 當該屬性設置為 false 時,下次調用該輪轉時將輸出同樣的值.

如果指定了 “assign” 這個特殊屬性,該輪轉的輸出值將被賦給由 assign 指定的模板變量,而不是直接輸出。

例子:

{section name=rows loop=$data}{$data[rows]}{/section}

輸出:

123

html_options

屬性 類型 是否必須 缺省值 描述
values array Yes, unless using options attribute N/A 包含下拉列表各元素值的數組
output array Yes, unless using options attribute N/A 包含下拉列表各元素顯示值的數組
selected string/array No empty 已選定的元素或元素數組
options associative array Yes, unless using values and output N/A 包含值和顯示的關聯(lián)數組
name string No empty 下拉菜單的名稱

描述:

自定義函數 html_options 根據給定的數據創(chuàng)建選項組. 該函數可以指定哪些元素被選定. 要么必須指定 values 和 ouput 屬性,要么指定 options 替代。

如果給定值是數組,將作為 OPTGROUP 處理,且支持遞歸. 所有的輸出與 XHTML 兼容。

如果指定了可選屬性 name,該選項列表將將被置于標簽對中. 如果沒有指定,那么只產生選項列表。

上表未提到的其它參數在

例子:

index.php:

require('Smarty.class.php');$smarty = new Smarty;$smarty->assign('cust_ids', array(1000,1001,1002,1003));$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','JaneJohnson','Carlie Brown'));$smarty->assign('customer_id', 1001);$smarty->display('index.tpl');index.tpl:

index.php:

require('Smarty.class.php');$smarty = new Smarty;$smarty->assign('cust_options', array(1001 => 'Joe Schmoe',1002 => 'Jack Smith',1003 => 'Jane Johnson',1004 => 'Charlie Brown'));$smarty->assign('customer_id', 1001);$smarty->display('index.tpl');

index.tpl:

輸出:

html_select_date

屬性 類型 是否必須 缺省值 描述
prefix string No Date_ 變量名稱前綴
time timestamp/YYYY-MMDD No UNIX時間戳或年-月-日 使用時間類型(data/time)
start_year string No 年份或與當前年份的相對值 下拉列表中第一個年份,或與當前年份的相對值(正/負幾年)
end_year string No 同start_year 下拉列表中最后一個年份,或與當前年份的相對值(正/負幾年)
display_days boolean No true 是否顯示天
display_months boolean No true 是否顯示月
display_years boolean No true 是否顯示年
month_format string No %B 月份的表示方法(strftime)
day_format string No %02d 天顯示的格式(sprintf)
day_value_format string No %d 天的表示方法(sprintf)
year_as_text boolean No false 是否以文本方式顯示年份
reverse_years boolean No false 逆序顯示年份
field_array string No null 如果指定了名稱,選定的區(qū)域將以[Day],[Year],[Month]的形式返回給PHP(待考)
day_size string No null 如果給定,為標簽添加大小屬性
month_size string No null 如果給定,為標簽添加大小屬性
year_size string No null 如果給定,為標簽添加大小屬性
all_extra string No null 如果給定,為所有標簽添加附加屬性
day_extra string No null 如果給定,為標簽添加附加屬性
month_extra string No null 如果給定,為標簽添加附加屬性
year_extra string No null 如果給定,為標簽添加附加屬性
field_order string No MDY 顯示區(qū)域的順序
field_separator string No \n 各區(qū)域間輸出的分隔字符串
month_value_format string No %m 月份值的strftime表示方法,默認為%m

描述:

自定義函數 html_select_date 用于創(chuàng)建日期下拉菜單. 它可以顯示任意年月日.

例子:

{html_select_date}

輸出:

例子:

{* start and end year can be relative to current year *}{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1"display_days=false}

輸出:

html_radios

屬性 類型 是否必須 缺省值 描述
name string No radio 單選按鈕列表的名稱
values array Yes, 或指定 options 屬性 N/A 包含單選按鈕值的數組
output array Yes, 或指定 options 屬性 N/A 包含單選按鈕顯示值的數組
checked string No empty 已選定的元素
options associative array Yes, 或指定 values 屬性 N/A 包含值和顯示的關聯(lián)數組
separator string No empty 分隔每個單選按鈕的字符串

描述:

自定義函數 html_radios 根據給定的數據創(chuàng)建單選按鈕組. 該函數可以指定哪個元素被選定,要么必須指定 values 和 ouput 屬性,要么指定 options 替代. 所有的輸出與 XHTML 兼容,上表未提到的其它參數在 標簽中以”名稱/屬性”對的方式顯示.

例子:

index.php:

require('Smarty.class.php');$smarty = new Smarty;$smarty->assign('cust_ids', array(1000,1001,1002,1003));$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','JaneJohnson','Carlie Brown'));$smarty->assign('customer_id', 1001);$smarty->display('index.tpl');index.tpl:{html_radios values=$cust_ids checked=$customer_id output=$cust_namesseparator="
"}

index.php:

require('Smarty.class.php');$smarty = new Smarty;$smarty->assign('cust_radios', array(1001 => 'Joe Schmoe',1002 => 'Jack Smith',1003 => 'Jane Johnson',1004 => 'Charlie Brown'));$smarty->assign('customer_id', 1001);$smarty->display('index.tpl');

index.tpl:

{html_radios name="id" options=$cust_radios checked=$customer_id separator="
"}

輸出:

Joe Schmoe
Jane Johnson
Charlie Brown

以上就是關于ECSHOP模版系統(tǒng)的顯示標簽的全部內容,感謝大家的閱讀,更多內容請關注西部數碼技術頻道網站。

標簽: isp 代碼 網站 西部數碼 用戶

版權申明:本站文章部分自網絡,如有侵權,請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:ECShop評論中修改E-mail為非必填的修改方法

下一篇:ECSHOP安裝數據庫失敗date_default_timezone_get()問題