fenom/docs/en/mods/escape.md
2014-08-02 00:24:14 +04:00

21 lines
598 B
Markdown

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:
```smarty
{$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.