pre_hook | R Documentation |
Pre Hook Response
pre_hook(content, data)
content |
File content, a character vector. |
data |
A list of data passed to |
A response pre-hook.
my_prh <- function(self, content, data, ext, ...) {
data$title <- "Mansion"
pre_hook(content, data)
}
#' Handler for GET at '/'
#'
#' @details Renders the homepage
#' @export
home_get <- function(req, res) {
res$pre_render_hook(my_prh)
res$render(
file = "page.html",
data = list(
title = "Home"
)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.