Escape in Smarty
This is used to html escape, url escape, escape single quotes on a variable not already escaped, hex escape, hexentity or javascript escape. By default, the variable is html escaped.
Example
<?php
$smarty->assign(’input’,
“‘Test String’”
);
?>
In template,
{$input}
{$input|escape}
{$input|escape:”html”} {* escapes & ” ‘ < > *}
{$input|escape:”htmlall”} {* escapes ALL html entities *}
{$input|escape:”url”}
{$input|escape:”quotes”}
The output will be as follows:
‘’Test String’
‘’Test String’
‘’Test String’
‘’Test String’
%27Test+String%27
\'’Test String\’
