- 浏览: 712763 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
一剪梅:
关于您对于 hasRolePermission 用法的解释, ...
OFBIZ安全性技术(翻译) -
沈寅麟:
数据模型资源手册卷3中文版出版了 -
donaldjohn:
恭喜恭喜, 预祝大卖
数据模型资源手册卷3中文版出版了 -
成大大的:
OFBiz电商实战百度网盘下载:http://pan.baid ...
OFBiz入门实训教程 -
成大大的:
OFBiz电商实战百度网盘下载:http://pan.baid ...
OFBiz促销码生成解释
一:if指令:
<#if condition>
...
<#elseif condition2>
...
<#elseif condition3>
...
...
<#else>
...
</#if>
二:switch
<#switch value>
<#case refValue1>
...
<#break>
<#case refValue2>
...
<#break>
...
<#case refValueN>
...
<#break>
<#default>
...
</#switch>
三:list,break
<#list sequence as item>
...
</#list>
两个特殊的循环变量:
item_index: 当前变量的索引值。
item_has_next: 是否存在下一个对象。
可以用<#break/>指令离开loop循环。
四:include指令
<#include filename>
或者
<#include filenameoptions>
filename: 表达式转换为字符串
options: encoding=encoding, parse=parse
encoding: 表达式转换为字符串
parse: 表达式转换为逻辑值,是否作为ftl文件解析。
<#include "/common/navbar.html" parse=false encoding="Shift_JIS">
<#include "*/footer.ftl">表示当前目录下以及所有父目录下的文件。
如果当前模版在/foo/bar/template.ftl ,那么查找footer.ftl的顺序为:
/foo/bar/footer.ftl
/foo/footer.ftl
/footer.ftl
这种方式讲允许设计者将通用的模版放在父文件夹里面。
也可以只指定部分路径:<#include "*/commons/footer.ftl">
五:import指令
<#import path as hash>
六:noparse
<#noparse>
...
</#noparse>
七:compress
<#compress>
...
</#compress>
八:escape,noescape
<#escape identifier as expression>
...
<#noescape>...</#noescape>
...
</#escape>
escape指令body区的ftl的interpolations都会被自动加上escape表达式。但是不会影响字符串内的interpolations。而且也只会影响到body内出现的interpolations,比如不会影响到include的ftl的interpolations。
<#if condition>
...
<#elseif condition2>
...
<#elseif condition3>
...
...
<#else>
...
</#if>
二:switch
<#switch value>
<#case refValue1>
...
<#break>
<#case refValue2>
...
<#break>
...
<#case refValueN>
...
<#break>
<#default>
...
</#switch>
三:list,break
<#list sequence as item>
...
</#list>
两个特殊的循环变量:
item_index: 当前变量的索引值。
item_has_next: 是否存在下一个对象。
可以用<#break/>指令离开loop循环。
四:include指令
<#include filename>
或者
<#include filenameoptions>
filename: 表达式转换为字符串
options: encoding=encoding, parse=parse
encoding: 表达式转换为字符串
parse: 表达式转换为逻辑值,是否作为ftl文件解析。
<#include "/common/navbar.html" parse=false encoding="Shift_JIS">
<#include "*/footer.ftl">表示当前目录下以及所有父目录下的文件。
如果当前模版在/foo/bar/template.ftl ,那么查找footer.ftl的顺序为:
/foo/bar/footer.ftl
/foo/footer.ftl
/footer.ftl
这种方式讲允许设计者将通用的模版放在父文件夹里面。
也可以只指定部分路径:<#include "*/commons/footer.ftl">
五:import指令
<#import path as hash>
六:noparse
<#noparse>
...
</#noparse>
七:compress
<#compress>
...
</#compress>
八:escape,noescape
<#escape identifier as expression>
...
<#noescape>...</#noescape>
...
</#escape>
escape指令body区的ftl的interpolations都会被自动加上escape表达式。但是不会影响字符串内的interpolations。而且也只会影响到body内出现的interpolations,比如不会影响到include的ftl的interpolations。
<#escape x as x?html>
First name: ${firstName}
Last name: ${lastName}
Maiden name: ${maidenName}
</#escape>
等同于:
First name: ${firstName?html}
Last name: ${lastName?html}
Maiden name: ${maidenName?html}
escape指令在解析模版时起作用,而不是运行时起作用。
escape指令还能嵌套使用,子继承父的escape规则。
<#escape x as x?html>
Customer Name: ${customerName}
Items to ship:
<#escape x as itemCodeToNameMap[x]>
${itemCode1}
${itemCode2}
${itemCode3}
${itemCode4}
</#escape>
</#escape>
等同于:
Customer Name: ${customerName?html}
Items to ship:
${itemCodeToNameMap[itemCode1]?html}
${itemCodeToNameMap[itemCode2]?html}
${itemCodeToNameMap[itemCode3]?html}
${itemCodeToNameMap[itemCode4]?html}
九:assign指令
<#global name=value>
or
<#global name1=value1name2=value2... nameN=valueN>
or
<#global name>
capture this
</#global>
十一:local指令
<#local name=value>
or
<#local name1=value1name2=value2... nameN=valueN>
or
<#local name>
capture this
</#local>
只能用于macro的定义body中。
十二:setting指令:
<#setting name=value>
name的取值范围:
local:
number_format:
boolean_format:缺省值为"true,false"
date_format, time_format, datetime_format
time_zone:
url_escaping_charset
classic_compatible
十三:用户自定义指令
<#macro nameparam1param2... paramN>
...
<#nested loopvar1, loopvar2, ..., loopvarN>
...
<#return>
...
</#macro>
十五:function, return
<#function nameparam1param2... paramN>
... <#return returnValue>
...
</#function>
<#function avg x y>
<#return (x + y) / 2>
</#function>
${avg(10, 20)}
十六:flush
<#flush>
十七:stop
<#stop>
or
<#stop reason>
取消处理模版。
十八:ftl指令
<#ftl param1=value1param2=value2...paramN=valueN>
ftl指令必须放在ftl文件的最上面。
参数范围:
encoding:
strip_whitespace
strip_text
strict_syntax
十九:t, lt, rt
二十:attempt, recover
<#attempt>
attempt block
<#recover>
recover block
</#attempt>
Last name: ${lastName?html}
Maiden name: ${maidenName?html}
escape指令在解析模版时起作用,而不是运行时起作用。
escape指令还能嵌套使用,子继承父的escape规则。
<#escape x as x?html>
Customer Name: ${customerName}
Items to ship:
<#escape x as itemCodeToNameMap[x]>
${itemCode1}
${itemCode2}
${itemCode3}
${itemCode4}
</#escape>
</#escape>
等同于:
Customer Name: ${customerName?html}
Items to ship:
${itemCodeToNameMap[itemCode1]?html}
${itemCodeToNameMap[itemCode2]?html}
${itemCodeToNameMap[itemCode3]?html}
${itemCodeToNameMap[itemCode4]?html}
九:assign指令
<#assign name=value>十:global指令
or
<#assign name1=value1name2=value2... nameN=valueN>
or
<#assign same as above... in namespacehash>
or
<#assign name>
capture this
</#assign>
or
<#assign name in namespacehash>
capture this
</#assign>
创建或者替换一个已经存在的变量,只能作用于顶层变量。
不好的做法:<#assign x>Hello ${user}!</#assign>
更改为:<#assign x="Hello ${user}!">
<#global name=value>
or
<#global name1=value1name2=value2... nameN=valueN>
or
<#global name>
capture this
</#global>
十一:local指令
<#local name=value>
or
<#local name1=value1name2=value2... nameN=valueN>
or
<#local name>
capture this
</#local>
只能用于macro的定义body中。
十二:setting指令:
<#setting name=value>
name的取值范围:
local:
number_format:
boolean_format:缺省值为"true,false"
date_format, time_format, datetime_format
time_zone:
url_escaping_charset
classic_compatible
十三:用户自定义指令
<@macro_or_transfparam1=val1param2=val2...paramN=valN/><@macro_or_transfparam1=val1param2=val2...paramN=valN ; lv1, lv2, ..., lvN/><@macro_or_transf...>十四:macro,nested,return
...
</@macro_or_transf>
<@macro_or_transf...>
...
</@><@macro_or_transfval1, val2, ..., valN/>
<#macro nameparam1param2... paramN>
...
<#nested loopvar1, loopvar2, ..., loopvarN>
...
<#return>
...
</#macro>
十五:function, return
<#function nameparam1param2... paramN>
... <#return returnValue>
...
</#function>
<#function avg x y>
<#return (x + y) / 2>
</#function>
${avg(10, 20)}
十六:flush
<#flush>
十七:stop
<#stop>
or
<#stop reason>
取消处理模版。
十八:ftl指令
<#ftl param1=value1param2=value2...paramN=valueN>
ftl指令必须放在ftl文件的最上面。
参数范围:
encoding:
strip_whitespace
strip_text
strict_syntax
十九:t, lt, rt
二十:attempt, recover
<#attempt>
attempt block
<#recover>
recover block
</#attempt>
<#attempt>
Optional content: ${thisMayFails}
<#recover>
Ops! The optional content is not available.
</#attempt>
Optional content: ${thisMayFails}
<#recover>
Ops! The optional content is not available.
</#attempt>
发表评论
-
OFBiz抽取实体引擎和服务引擎思路(1)
2020-03-31 00:39 552# OFBiz抽取实体引擎和服务引擎思路(1) ... -
minilang开发日志书写规范
2019-01-02 10:34 527minilang书写日志5步法 任何一个xml方法中必须 ... -
自动化配置界面表定义思路1.0
2018-11-24 23:21 740总表 path 唯一编码 tableName 表名 ... -
OFBiz前端VUE组件规划
2018-11-10 10:51 1027iasudu.iteye.com 编 号 : ____ ... -
增强OFBiz通用查询方法思路
2018-11-09 17:15 695增强OFBiz通用查询方法思路 <se ... -
OFBiz前后端分离项目代码规范建议2018版
2018-05-11 09:43 1375OFBiz前后端分离项目代码规范建议__build2018 ... -
前端脚手架使用指导
2018-03-02 14:44 6811 安装nodejs https://nodejs.or ... -
RestEventHandler
2018-02-01 23:37 5/**************************** ... -
数据模型资源手册卷3中文版出版了
2017-02-18 11:58 1941我翻译的数据模型资源手册卷3出版了 -
OFBiz促销码生成解释
2014-10-07 22:07 1502OFBiz 我的购物车 输入固定的邀请码实现优惠促销 需要解 ... -
电商基本页面
2014-09-18 20:49 1704<!--StartFragment--> ... -
OFBiz入门实训教程
2014-07-14 14:28 2961加速度 15000850008 大家好,为了ofbiz的 ... -
创建OFBiz的jQuery Mobile入门页面
2014-06-13 14:21 1781jQuery Mobile 框架是一套 ... -
店铺研究
2014-05-23 23:11 1087店铺权限研究,规划如下权限: 分店库存管理权限 分店进货权限 ... -
15天用OFBiz做一个商城管理后台和店铺管理后台
2014-05-03 20:33 3996仅仅是记录一些弟兄们的工作经历。没有吹嘘使用OFBiz使用效率 ... -
一个朋友做OFBiz Crud遇到的问题
2014-01-02 12:55 1752Crud 遇到的问题 问题1:在myeclipse中开发的of ... -
OFBiz的Cache研究
2013-12-30 14:35 2362任何一个cache对象的配置属性都可以在cache.prope ... -
OFBiz同步设置说明和示例
2013-11-23 02:03 1734同步设置说明和示例 使 ... -
OFBiz的Axis2
2013-11-16 23:43 1157很多人都对Axis2的封装和调用苦恼。 今天再次深入精读OFB ... -
How to create a new component
2013-09-21 23:31 965How to create a new component ...
相关推荐
赠送jar包:freemarker-2.3.30.jar; 赠送原API文档:freemarker-2.3.30-javadoc.jar; 赠送源代码:freemarker-2.3.30-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.30.pom; 包含翻译后的API文档:...
赠送jar包:freemarker-2.3.31.jar; 赠送原API文档:freemarker-2.3.31-javadoc.jar; 赠送源代码:freemarker-2.3.31-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.31.pom; 包含翻译后的API文档:...
赠送jar包:freemarker-2.3.30.jar; 赠送原API文档:freemarker-2.3.30-javadoc.jar; 赠送源代码:freemarker-2.3.30-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.30.pom; 包含翻译后的API文档:...
freemarker-2.3.26-incubating中文手册
赠送jar包:freemarker-2.3.23.jar; 赠送原API文档:freemarker-2.3.23-javadoc.jar; 赠送源代码:freemarker-2.3.23-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.23.pom; 包含翻译后的API文档:...
========>压缩包内有文件:freemarker-ide-0.9.14.zip、README.txt(安装教程)
赠送jar包:freemarker-2.3.20.jar; 赠送原API文档:freemarker-2.3.20-javadoc.jar; 赠送源代码:freemarker-2.3.20-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.20.pom; 包含翻译后的API文档:...
赠送jar包:freemarker-2.3.20.jar; 赠送原API文档:freemarker-2.3.20-javadoc.jar; 赠送源代码:freemarker-2.3.20-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.20.pom; 包含翻译后的API文档:...
赠送jar包:freemarker-2.3.23.jar; 赠送原API文档:freemarker-2.3.23-javadoc.jar; 赠送源代码:freemarker-2.3.23-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.23.pom; 包含翻译后的API文档:...
赠送jar包:freemarker-2.3.31.jar; 赠送原API文档:freemarker-2.3.31-javadoc.jar; 赠送源代码:freemarker-2.3.31-sources.jar; 赠送Maven依赖信息文件:freemarker-2.3.31.pom; 包含翻译后的API文档:...
freemarker-2.3.23-中文手册,很全的Freemarker资料,涵盖官方文档的API和使用方法。
ssm整合freemarker---Demo 还有pagehelper 分页插件
官网目前最新版本, springMVC4配置html视图解析器会依赖到 (includes freemarker.jar and documentation)
设计师可以改变的外观网页程序员无需更改或重新编译代码,因为应用程序逻辑( Java程序)和网页设计( FreeMarker模板)分开。 模板不会成为污染的复杂程序片段。 这一分离是有益的,在网页代码中,你甚至会觉得是...
freemarker-ide-0.9.14-eclipse插件,安装到myeclipse中,就是安装好后ftl文件标签变色等。
下载解压后,将文件夹中的plugins目录下的hudson.freemarker_ide_0.9.14目录拷贝到MyEclipse6.5安装目录/子目录中的所有plugins目录中,重启下就好了。
java freemarker导出word -包含多张图片导出
camel-freemarker-1.6.4.jar, camel-freemarker-2.8.1.jar, com.springsource.freemarker-2.3.15.jar, com.springsource.freemarker-sources-2.3.15.jar, freemarker-1.4.1.jar, freemarker-2-3-18.jar, freemarker-...
freemarker操作手册-完整freemarker教程:完整的freemarker操作手册,对需要学习了解freemarker的人有一定帮助