escape
Parameter Position
Type
Required
Possible Values
Default
Description
1
string
No
html,htmlall,url,quotes,hex,hexentity,javascript
html
This is the escape format to use.
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.
escape
assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
$smarty->display('index.tpl');
?>
]]>
Where index.tpl is:
*}
{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
{$articleTitle|escape:"url"}
{$articleTitle|escape:"quotes"}
{$EmailAddress|escape:"hexentity"}
]]>
This will output:
bob@me.net
]]>