如何将默认值添加到智能日期下拉列表中?

时间:2016-04-26 07:35:56

标签: smarty

我正在制作一个date dropdown using smarty syntax,只显示年份

它与当前年份的选择完美展现。

但我想要显示文字,例如"Select Year" with value=' '并点击它会在下拉菜单中显示剩余的年份以供选择。

有人可以建议如何在smarty中做到这一点吗?

以下是我的代码..

{html_select_date prefix="from" display_days=false display_months=false start_year=-20 month_extra='id="fromMonth"' year_extra='id="fromYear"'}  

谢谢。

1 个答案:

答案 0 :(得分:1)

如果您正在使用Smarty 3,只需在函数中添加两个参数:

year_empty="Select year" time=null