Skip to content

Instantly share code, notes, and snippets.

@a-ono
Created January 27, 2014 02:47
Show Gist options
  • Save a-ono/8642560 to your computer and use it in GitHub Desktop.
Save a-ono/8642560 to your computer and use it in GitHub Desktop.
play2 linkTo
def linkTo(label: String, url: String, options: (Symbol, Any)*) = Html(
options.foldLeft(<a href={url}>{label}</a>) {
case (elem, (k, v)) =>
elem % new xml.UnprefixedAttribute(k.name, v.toString, elem.attributes)
}.toString
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment