arrays - Create "object" in freemarker only (no JAVA etc)? -
after reading freemarker documentation , googling don't see how can build test object (like associated, multilevel array) in freemarker only.
so like:
<#assign seq=["a","b","c"]>
but in more depth - (pseudo):
aa ab ac ad b ba bb bc c ca cb cc cd ce
is possible in freemarker (as front-end dev waiting back-end guys finish need work on , not use bare arrays)?
tnx
that's not multi-level array, because each nested array has name ("a", "b", "c"). closest can think of is:
<#assign foo = { "a": ["aa", "ab", "ac", "ad"], "b": ["ba", "bb", "bc"], "c": ["ca", "cb", "cc", "cd", "ce"] }>
but there have utilized ftl hash literals keep key order. without that:
<#assign foo = [ {"name" : "a", "value": [ "aa", "ab", "ac", "ad"]}, {"name" : "b", "value": [ "ba", "bb", "bc"]}, {"name" : "c", "value": [ "ca", "cb", "cc", "cd", "ce"]} ]>
Comments
Post a Comment