Created
January 27, 2014 02:47
-
-
Save a-ono/8642560 to your computer and use it in GitHub Desktop.
play2 linkTo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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