title: How does this Play 2 ScalaTemplates code work
body: <p>Please explain the code below:</p>
  
  <pre><code>@title(text: String) = @{
    text.split(' ').map(_.capitalize).mkString(" ")
  }
  
  &lt;h1&gt;@title("hello world")&lt;/h1&gt;
  </code></pre>