req_has_query {scenes} | R Documentation |
Switch Scenes on Query
Description
Create a scene_action
specifying a key that must be present (or absent) in
the query string (the part of the URL when the shiny app was called, after
"?"), and optionally a value or values for that key. For example, in
myapps.shinyapps.io/myapp?param1=1¶m2=text
, ?param1=1¶m2=text
is
the query string, param1
and param2
are keys, and 1
and text
are
their corresponding values.
Usage
req_has_query(key, values = NULL, negate = FALSE)
Arguments
key |
The key that must be present, as a length-1 character vector. |
values |
Details about what to look for in the |
negate |
If |
Value
A scene_action
object, to be used in set_scene()
.
Examples
# Specify an action to detect a "code" parameter in the query.
req_has_query("code")
# Specify an action to detect the *lack* of a "code" parameter in the query.
req_has_query("code", negate = TRUE)
# Specify an action to detect a "language" parameter, with values containing
# "en" or "es".
req_has_query("language", "en|es")