replace()

Usage

replace(template, entity)

Description
Replaces all template expressions in the given template string with values from the given entity. This method can be used to evaluate template expressions in database objects, for example to create customized e-mails etc.

Warning
Allowing user input to be evaluated in a template expression poses a security risk. You have no control over what the user can do!

Example

${replace('Welcome, ${this.name}!', me)}

results in

Welcome, admin!
About this article
Last change 2018-05-04
Topics FrontendFunctionsStructr 2.0