第6章 Hello Velocity World!
一个变量被赋值后,便可以在HTML文档中引用它。下面的是变量$foo 赋值然后引用的例子。
<html>
<body>
#set( $foo = "Velocity" )
Hello $foo World!
</body>
<html>
这个页面的输出结果是"Hello Velocity World!"。
出于可读性考虑,每个VTL语句最好另起一行。set 指令将在后续深入解释。
<html>
<body>
#set( $foo = "Velocity" )
Hello $foo World!
</body>
<html>
这个页面的输出结果是"Hello Velocity World!"。