5 This template is used for Velocity regression testing.
6 If you alter this template make sure you change the
7 corresponding comparison file so that the regression
8 test doesn't fail incorrectly.
12 Start with simple string interpolation :
15 $provider.concat("it will cost you $10.00", "")
18 $provider.concat("${image}.jpg", "")
20 #set($foo-bar = "foobar")
21 $provider.concat("${foo-bar}.jpg", "")
23 #set($foo_bar = "foobar")
24 $provider.concat("${foo_bar}.jpg", "")
29 $provider.concat("${one}${two}${three}", "")
30 $provider.concat("$one $two $three", "")
32 How about a directive? Sure :
34 #set($arr = ["a","b","c"])
35 #set($foo = "#foreach($a in $arr) >$a< #end")
39 For our next trick, lets interpolate a.... VelociMacro!
45 #set($ivm = "#interpfoo()")
49 And now, for something completely different :
51 #set($code = "#if(false) True #else False #end")
55 Now, non interpolated stringlits :
59 #set($c = '$!$\!code')