add_router_callback | R Documentation |
Set a router callback function
add_router_callback(router, callback = c("pageload", "default"), func)
router |
A router object. |
callback |
The name of the callback to set. Currently |
func |
The callback function. The function should take a |
Invisibly returns the input router
object.
router()
## Not run: add_router_callback( router, "pageload", function(page, session) { shinyjs::runjs(paste0("document.title = \"", page$title, "\";")) } ) add_router_callback( router, "default", function(session) { if ("dev" %in% session$groups) { "devlanding" } else { "home" } } ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.