c

play.twirl.api

StringInterpolation

implicit final class StringInterpolation extends AnyVal

Brings the template engine as a string interpolator.

Basic usage:

import play.twirl.api.StringInterpolation

val name = "Martin"
val htmlFragment: Html = html"<div>Hello $name</div>"

Three interpolators are available: html, xml and js.

Source
package.scala
Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StringInterpolation
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new StringInterpolation(sc: StringContext)

Value Members

  1. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  2. def html(args: Any*): Html
  3. def interpolate[A <: Appendable[A]](args: Seq[Any], format: Format[A])(implicit arg0: ClassTag[A]): A
  4. def js(args: Any*): JavaScript
  5. val sc: StringContext
  6. def xml(args: Any*): Xml