Format

play.twirl.api.Format
trait Format[T <: Appendable[T]]

A template format defines how to properly integrate content for a type T (e.g. to prevent cross-site scripting attacks)

Type parameters

T

The underlying type that this format applies to.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object HtmlFormat
object TxtFormat
object XmlFormat

Members list

Type members

Types

type Appendable = T

Value members

Abstract methods

def empty: T

Generate an empty appendable

Generate an empty appendable

Attributes

def escape(text: String): T

Integrate text after escaping special characters. e.g. for HTML, “<” becomes “&lt;”

Integrate text after escaping special characters. e.g. for HTML, “<” becomes “&lt;”

Value parameters

text

Text to integrate

Attributes

def fill(elements: Seq[T]): T

Fill an appendable with the elements

Fill an appendable with the elements

Attributes

def raw(text: String): T

Integrate text without performing any escaping process.

Integrate text without performing any escaping process.

Value parameters

text

Text to integrate

Attributes