pre_hook {ambiorix} | R Documentation |
Pre Hook Response
Description
Pre Hook Response
Usage
pre_hook(content, data)
Arguments
content |
File content, a character vector. |
data |
A list of data passed to |
Value
A response pre-hook.
Examples
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"
)
)
}
[Package ambiorix version 2.2.0 Index]