fenom/docs/mods/escape.md
2014-01-29 10:01:31 +02:00

598 B

Modifier escape

The modifier escapes a string for safe insertion into the output. It supports different escaping strategies depending on the template context. By default, it uses the HTML escaping strategy:

{$post.title|escape:'html'}

The modifier supports the following escaping strategies:

  • html: escapes a string for the HTML body context.
  • url: escapes a string for the URI or parameter contexts.
  • js: escapes a string for the JavaScript context.

For convenience, the e modifier is defined as an alias of escape modifier.

Second parameter is charset.