Say you have a standard template with included (parsed) header, body, footer templates.
In the body template a variable like $subject is defined and you want that also displayed in the header template.
In some other template languages like HTML::Mason(perl based) you would evaluate the body template first to pick up the $subject variable but store it's output temporarily in a variable so your final output could end up in the correct order (header, body, footer)
In velocity it would look something like
This however doesn't seem to work, any thoughts on how to do this?
以上就是Velocity #parse but assign it to a variable的详细内容，更多请关注web前端其它相关文章！