Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to escape the "@" in play framework templates?

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.

like image 225
Ezequiel Gorbatik Avatar asked Jun 12 '13 23:06

Ezequiel Gorbatik


People also ask

What is twirl template?

A type safe template engine based on Scala Play comes with Twirl, a powerful Scala-based template engine, whose design was inspired by ASP.NET Razor. Specifically it is: compact, expressive, and fluid: it minimizes the number of characters and keystrokes required in a file, and enables a fast, fluid coding workflow.

Which component is responsible for building play framework?

Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java.


1 Answers

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

like image 184
Ezequiel Gorbatik Avatar answered Oct 23 '22 04:10

Ezequiel Gorbatik