Created
October 27, 2017 13:03
-
-
Save michbarsinai/25a205588601bcace2697f7cc03f6413 to your computer and use it in GitHub Desktop.
Twirl/Play mini function for presenting a HTML fragment for non-null, non-empty strings
This file contains hidden or 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 nonEmpty( v:String )(f:(String=>Html)):Html = { | |
if ( v != null && v.trim.nonEmpty ) { | |
f(v.trim) | |
} else { | |
Html("") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment