I want to slugify an object's String attr to use it in urls. I've read that there was a function called "slugify" in play 1.x, but i can't find it in play 2.x
What's the best method to slugify a String in play 2.x?
If i have to implement the function (or any helper function like this) where should I place it for best accessibility for the whole mvc?
As noted in https://groups.google.com/forum/#!topic/play-framework/r-raDXl95Q4, there is no builtin slugify helper in Play 2. But it's easy enough to build your own. Here's one example:
https://github.com/julienrf/chooze/blob/master/app/util/Util.scala#L6
The author places the helper under app/util, which is as reasonable a place as any, IMO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With