How to escape the “@” in play framework templates?

半腔热情 提交于 2019-12-08 14:55:55

问题


How to escape the @ in play framework templates (view and tags)? If you add a "@" in any view in play framework it will be automatically processed by the template processor. Even if is an email address or a twitter account.


回答1:


Just repeat the @ for example as @@: MyTestView.scala.html

@()
<html>
   <body>
      Follow me at @@myTwitter
   </body>
</html>

The information can be found at http://www.playframework.com/documentation/2.0/ScalaTemplates



来源:https://stackoverflow.com/questions/17077132/how-to-escape-the-in-play-framework-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!