首页 > 其他 > 详细

freemarker自己定义标签(一)

时间:2015-02-09 10:42:54      阅读:264      评论:0      收藏:0      [点我收藏+]

freemarker自己定义标签


1、自己定义标签说明

     宏变量存储模板片段能够被用作自己定义指令macro


2、演示样例说明

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>freemarker自己定义标签</title>

  </head>
  
  <body>
     <#--freemarker自己定义标签-->
	 <#macro write>
	     repeat("张三丰",3)
	 </#macro>
	 
	 <@write/>
  </body>
</html>

3、演示样例结果

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>freemarker自己定义标签</title>

  </head>
  
  <body>
     	 
	     repeat("张三丰",3)
  </body>
</html>


freemarker自己定义标签(一)

原文:http://www.cnblogs.com/gcczhongduan/p/4280876.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!