Velocity #parse but assign it to a variable

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 set ($body=#parse("body.vm")) parse("header.vm") ${body} parse("footer.vm") This however doesn't seem to work, any thoughts on how to do this?

以上就是Velocity #parse but assign it to a variable的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏