I am trying to migrate a rather large project from play framework 2.2 to 2.3. In the project we have some helpers that do something like this:
import play.api.templates.Html;
...
private object HtmlHelper {
...
// Given a sequence of Htmls, return a single Html containing them
def html(htmls: Seq[Html]): Html = htmls.foldLeft(Html(""))(_+=_)
}
I have converted it to this:
import play.twirl.api.Html;
...
private object HtmlHelper {
...
// Given a sequence of Htmls, return a single Html containing them
def html(htmls: Seq[Html]): Html = htmls.foldLeft(Html(""))((r,c) => r + c)
}
This fails to compile with the following error:
Read from stdout: <PATH> type mismatch;
Read from stdout: found : play.twirl.api.Html
Read from stdout: required: String
I've been trying to find documentation on this Html object in 2.3 but have had no luck finding anything. As far as I can see, the Html object implements Appendable, which means the + operator should work... I don't have time to learn all of Scala and this supposed "expressive" syntax is getting on my nerves.
Any help would be appreciated.