Created
September 11, 2018 04:11
-
-
Save Wavesonics/839b283eaf1245ffbe251f8d8a6e3016 to your computer and use it in GitHub Desktop.
A very simple helper for reverse routes in templates
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
class RouteHelper(private val router: Router) : BasicValueHelper() | |
{ | |
override fun execute(options: Options?) | |
{ | |
options?.parameters?.get(0)?.let { routeName -> | |
val route = router.uriFor(routeName.toString(), mutableMapOf()) | |
append(options, route) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment