fenom/docs/en/tags/raw.md

30 lines
639 B
Markdown
Raw Permalink Normal View History

2014-01-28 21:31:26 +04:00
Tag {raw}
=========
2013-07-07 01:34:37 +04:00
2014-01-28 21:31:26 +04:00
Tag `{raw <expression>}` allow outputs render results without escaping.
This tag rewrite global option `auto_escape` for specified code.
2013-07-07 01:34:37 +04:00
```smarty
{autoescape true}
...
{$var|up} {* escape *}
{raw $var|up} {* unescape *}
...
{"name is: <b>{$name|low}</b>"} {* escape *}
{raw "name is: <b>{$name|low}</b>"} {* unescape *}
...
{/autoescate}
```
2014-01-28 21:31:26 +04:00
For functions use tag with prefix `raw:`:
2013-07-07 01:34:37 +04:00
```smarty
{autoescape true}
...
{my_func page=5} {* escape *}
{my_func:raw page=5} {* unescape *}
2013-07-07 01:34:37 +04:00
...
{/autoescate}
```
2014-01-28 21:31:26 +04:00
Tag can not be applied to compilers as `foreach`, `if` and other.