Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why aren't quotation marks necessary in Play framework controller?

This works:

object Application extends Controller {
  def index = Action {
    Ok(<h1>hello world</h1>)
  }
}

But I would have expected to need to write Ok("<h1>hello world</h1"), using quotation marks. Why isn't this necessary (from a Scala POV)?

like image 500
Kiwi Avatar asked Jul 07 '26 16:07

Kiwi


1 Answers

Scala supports XML literals as a first-class part of the language: http://www.scala-lang.org/node/131. This is built in to the language and the choice of framework is irrelevant.

like image 144
Richard Cook Avatar answered Jul 09 '26 19:07

Richard Cook



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!