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"
)
)
}
Run the code above in your browser using DataLab