zoukankan      html  css  js  c++  java
  • freemaker的函数使用

    如下:

    <html>
       <body>
          <div class="container">
          <h4>修改用户角色</h4>
    <#function contain userList roleTypeId>
    	<#local num=0>
    	<#list userList as userList>
    		<#if userList.roleTypeId ==roleTypeId>
    			<#local num = num +1 >
    		</#if>
    	</#list>
    	<#return num>
    </#function>
        <form role="form" method="post" action="/userManage/userRoleSave" enctype="multipart/form-data">
            <label class="label-tips" for="u">账号:</label>
            <span id="username">${(userinfo.username)!''}</span><p>
            
            <label class="label-tips" for="nickname">昵称:</label>
            <span id="nickname">${(userinfo.nickname)!''}</span><p>
                    
            <label class="label-tips" for="roles">已有角色:</label><p>
            <#list userinfo.roles as userRoleList>
            <tr>
            	<td>
            		<span id="roleName">${(userRoleList.roleTypeId)!''}.${(userRoleList.roleName)!''}&nbsp&nbsp&nbsp&nbsp</span>
            	</td>
            </tr>
            </#list><p>
    		<label class="label-tips" for="u">修改角色: </label><p>
            <#list roles as rolesList>
            	<input type="checkbox" name="roleTypeIdList" id="sexMAN" value="${(rolesList.roleTypeId)!''}"  <#if contain(userinfo.roles,rolesList.roleTypeId)==1 > checked="checked" </#if>>${(rolesList.roleTypeId)!''}.${(rolesList.roleName)!''}&nbsp&nbsp&nbsp&nbsp  			
      	</#list>
            	<input hidden type="text" name="userid" value="${(userinfo.userid)!''}"><p>
                 <input type="submit" name="修改"/>${(msg?if_exists)!''}
        </form>
        
    </div>
    
    </body>
    </html>
    

      

  • 相关阅读:
    [APIO2014]序列分割
    [HNOI2008]玩具装箱TOY
    [ZJOI2007]时态同步
    [FJOI2014]最短路径树问题
    [IOI2011]Race
    [国家集训队]聪聪可可
    矩阵加速递推
    Codeforces Round #669 题意及思路
    Codeforces Round #670 题意及思路
    Codeforces Round #671 题意及思路
  • 原文地址:https://www.cnblogs.com/amoyzhu/p/9203346.html
Copyright © 2011-2022 走看看