日期:2014-05-17 浏览次数:20753 次
//在action中 $fromYear = "2010"; //起始年 $toYear = date("Y"); //结束年 $listYear = array(); while( $toYear >= $fromYear ){ $listYear[$fromYear] = $fromYear; ++$fromYear; } $this->assign("listYear",$listYear); $this->assign("selectYear",array($toYear)); /模板中 选择年: <div style="margin-left:10px;margin-bottom:10px;"> <tagLib name="html" /> <html:select options="listYear" selected="selectYear" id="Year" name="Year" /> 年 </div>