| 991 |
lars |
1 |
# unescape
|
| 148 |
lars |
2 |
|
|
|
3 |
`unescape` is used to decode `entity`, `html` and `htmlall`. It counters
|
| 991 |
lars |
4 |
the effects of the [escape modifier](language-modifier-escape.md) for the
|
| 148 |
lars |
5 |
given types.
|
|
|
6 |
|
| 991 |
lars |
7 |
## Basic usage
|
|
|
8 |
```smarty
|
|
|
9 |
{$myVar|unescape}
|
|
|
10 |
```
|
| 148 |
lars |
11 |
|
| 991 |
lars |
12 |
## Parameters
|
| 148 |
lars |
13 |
|
| 991 |
lars |
14 |
| Parameter Position | Type | Required | Possible Values | Default | Description |
|
|
|
15 |
|--------------------|--------|----------|----------------------------------------------------------------------------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------|
|
|
|
16 |
| 1 | string | No | `html`, `htmlall`, `entity`, | `html` | This is the escape format to use. |
|
|
|
17 |
| 2 | string | No | `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](https://www.php.net/htmlentities) | `UTF-8` | The character set encoding passed to html\_entity\_decode() or htmlspecialchars\_decode() or mb\_convert\_encoding() et. al. |
|
| 148 |
lars |
18 |
|
| 991 |
lars |
19 |
## Examples
|
| 148 |
lars |
20 |
|
| 991 |
lars |
21 |
```php
|
|
|
22 |
<?php
|
| 148 |
lars |
23 |
|
| 991 |
lars |
24 |
$smarty->assign('articleTitle',
|
|
|
25 |
"Germans use "Ümlauts" and pay in €uro"
|
|
|
26 |
);
|
|
|
27 |
```
|
| 148 |
lars |
28 |
|
|
|
29 |
These are example `unescape` template lines followed by the output
|
|
|
30 |
|
| 991 |
lars |
31 |
```smarty
|
|
|
32 |
{$articleTitle}
|
|
|
33 |
Germans use "Ümlauts" and pay in €uro
|
| 148 |
lars |
34 |
|
| 991 |
lars |
35 |
{$articleTitle|unescape:"html"}
|
|
|
36 |
Germans use "Ümlauts" and pay in €uro
|
| 148 |
lars |
37 |
|
| 991 |
lars |
38 |
{$articleTitle|unescape:"htmlall"}
|
|
|
39 |
Germans use "Ümlauts" and pay in €uro
|
|
|
40 |
```
|
| 148 |
lars |
41 |
|
| 991 |
lars |
42 |
See also [escaping smarty parsing](../language-basic-syntax/language-escaping.md), [escape
|
|
|
43 |
modifier](language-modifier-escape.md).
|