Unlimited learning, half price | 50% off
Get 50% off unlimited learning

webdeveloper (version 1.0.5)

dynamicTemplate: Replace placeholder variables in a HTML document string.

Description

Replace placeholder variables in a HTML document string.

Usage

dynamicTemplate(x, replacements = c())

Value

A string of HTML with placeholder values replaced.

Arguments

x

HTML string with placeholder variables that need to be replaced.

replacements

A named vector or named list. Names should match a template variable acting as a placeholder in a HTML document string and values should be the text to replace the placeholders with.

Examples

Run this code
dynamicTemplate(
x = html(body(templateVar("body_var"))),
replacements = c("%%rvar-body_var%%" = div(p("body replacement")))
)

Run the code above in your browser using DataLab