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

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

1970-01-01    來(lái)源:

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬(wàn)Linux鏡像隨意使用

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

cycle

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

描述:

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

如果需要在模板中使用多個(gè)輪轉(zhuǎn),需要給出唯一的 name 屬性.

用戶可以設(shè)置 print 屬性為 false 強(qiáng)制不輸出當(dāng)前值. 該特性可以很方便地略過(guò)某個(gè)值.

advance 屬性用于重復(fù)使用某個(gè)值. 當(dāng)該屬性設(shè)置為 false 時(shí),下次調(diào)用該輪轉(zhuǎn)時(shí)將輸出同樣的值.

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

例子:

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

輸出:

123

html_options

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

描述:

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

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

如果指定了可選屬性 name,該選項(xiàng)列表將將被置于標(biāo)簽對(duì)中. 如果沒有指定,那么只產(chǎn)生選項(xiàng)列表。

上表未提到的其它參數(shù)在

例子:

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時(shí)間戳或年-月-日 使用時(shí)間類型(data/time)
start_year string No 年份或與當(dāng)前年份的相對(duì)值 下拉列表中第一個(gè)年份,或與當(dāng)前年份的相對(duì)值(正/負(fù)幾年)
end_year string No 同start_year 下拉列表中最后一個(gè)年份,或與當(dāng)前年份的相對(duì)值(正/負(fù)幾年)
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ū)域?qū)⒁訹Day],[Year],[Month]的形式返回給PHP(待考)
day_size string No null 如果給定,為標(biāo)簽添加大小屬性
month_size string No null 如果給定,為標(biāo)簽添加大小屬性
year_size string No null 如果給定,為標(biāo)簽添加大小屬性
all_extra string No null 如果給定,為所有標(biāo)簽添加附加屬性
day_extra string No null 如果給定,為標(biāo)簽添加附加屬性
month_extra string No null 如果給定,為標(biāo)簽添加附加屬性
year_extra string No null 如果給定,為標(biāo)簽添加附加屬性
field_order string No MDY 顯示區(qū)域的順序
field_separator string No \n 各區(qū)域間輸出的分隔字符串
month_value_format string No %m 月份值的strftime表示方法,默認(rèn)為%m

描述:

自定義函數(shù) 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 包含單選按鈕值的數(shù)組
output array Yes, 或指定 options 屬性 N/A 包含單選按鈕顯示值的數(shù)組
checked string No empty 已選定的元素
options associative array Yes, 或指定 values 屬性 N/A 包含值和顯示的關(guān)聯(lián)數(shù)組
separator string No empty 分隔每個(gè)單選按鈕的字符串

描述:

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

例子:

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

以上就是關(guān)于ECSHOP模版系統(tǒng)的顯示標(biāo)簽的全部?jī)?nèi)容,感謝大家的閱讀,更多內(nèi)容請(qǐng)關(guān)注西部數(shù)碼技術(shù)頻道網(wǎng)站。

標(biāo)簽: isp 代碼 網(wǎng)站 西部數(shù)碼 用戶

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

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

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