Skip to content

Instantly share code, notes, and snippets.

@Wavesonics
Created September 11, 2018 04:11
Show Gist options
  • Save Wavesonics/839b283eaf1245ffbe251f8d8a6e3016 to your computer and use it in GitHub Desktop.
Save Wavesonics/839b283eaf1245ffbe251f8d8a6e3016 to your computer and use it in GitHub Desktop.
A very simple helper for reverse routes in templates
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