1. 程式人生 > >freemarker ftl 檔案中寫radio單選框select 下拉框並且帶if條件判斷

freemarker ftl 檔案中寫radio單選框select 下拉框並且帶if條件判斷

<#list themes as t>
                  <#switch t.id>
                <#case "default">
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">藍色主題
                   <#break>
               <#case "gdocs">
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">淡藍主題
                   <#break>
   <#case "greenTheme">
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">綠色主題
                   <#break>
   <#case "hcBlack">                       
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">黑色主題
                   <#break>
   <#case "yellowTheme">                       
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">黃色主題
                   <#break>
                        <#default>
   <input name="console-options-theme-menu"  type="radio" <#if  t.selected> checked </#if> value="${t.id}">${t.title?html}${t.id?html}1
   </#switch>
                  </#list>