...
The sequence passed as a parameter is changed directly: the value is added to the end of the sequence.
N.B: Adding a value to a sequence created literally is not allowed as there is a risk of causing side effects during successive template executions:
Pas de format |
---|
<#assign emptySeq = []/><#assign> <#assign noUse = hardisCore.addToSequence(emptySeq, 1) />emptySeq> emptySeq size:${emptySeq?size} If this fragment of code is kept in a cache by FreeMarker, the emptySeq size will be 2 on the second execution. The place needs to be written: <#assign emptySeq = hardisCore.createArrayList() /><#assign> <#assign noUse = hardisCore.addToSequence(emptySeq, 1) />emptySeq> emptySeq size:${emptySeq?size} |
...
Parameters
Hardis - Tableau personnalisé | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
...
For example
Pas de format |
---|
<#assign newSeq = hardisCore.createArrayList() /><#assign> <#assign noUse = hardisCore.addToSequence(emptySeq, true) /><#assign> <#assign noUse = hardisCore.addToSequence(emptySeq, .now?date) /><#assign> <#assign noUse = hardisCore.addToSequence(emptySeq, [1, 2, 3]) />emptySeq> emptySeq size:${emptySeq?size} |
Hardis - Haut de page |
---|
↑ Top of page |
...