A page declared with a parameterised href (e.g. "/who/:id") exposes the
values matched in the URL through get_keys(). Call it with no argument
inside a page server, and pass it the request inside a page ui.
Usage
get_keys(x = shiny::getDefaultReactiveDomain())Examples
library(shiny)
page(
href = "/who/:id",
ui = function(request) {
h1(get_keys(request)$id)
},
server = function(input, output, session) {
print(get_keys())
}
)
#> $href
#> [1] "/who/:id"
#>
#> $ui
#> function (request)
#> {
#> h1(get_keys(request)$id)
#> }
#> <environment: 0x5648cda54c50>
#>
#> $server
#> function (input, output, session)
#> {
#> print(get_keys())
#> }
#> <environment: 0x5648cda54c50>
#>
#> $method
#> [1] "get"
#>
#> $req_handlers
#> list()
#>
#> $res_handlers
#> list()
#>
#> attr(,"class")
#> [1] "brochure_page" "list"
