The #parse directive allows to import a local VTL file.
The file is parsed by the Velocity engine
Like the #include directive, #parse can take a variable rather than a literal file name,
Only one argument is accepted (only one file for each call, other arguments are ignored)
All the variables defined before the 'parse' call are usable in the 'parsed file'
Examples :
The file 'initvariables.vm' (file to be parsed) :
#set ( $a = "AAA" )
#set ( $n = 123 )
Value of v1 = $v1
Using the file 'initvariables.vm' with the 'parse' directive :
#set ( $v1 = "V1" ) ## Usable in "initvariables.vm"
#parse("initvariables.vm")
#set ( $v2 = "V2" ) ## Not usable in "initvariables.vm" (undefined)
Var a = $a ## variable defined in the parsed file
Var n = $n ## variable defined in the parsed file
Parse with subfolder :
#parse("include/initvariables.vm")