For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > September 2004 > HTML Entities









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML Entities
Jake Stride

2004-09-02, 4:01 pm

Is there a way to have smarty automatically replace all html entites in
variable in a template?

Ie

Code:

$smarty->assign("someVar", "One & one");

Template

{$someVar}

Would become

One & one?

Pete M

2004-09-02, 4:01 pm

{$someVar|escape:"htmlall"}

http://smarty.php.net/manual/en/lan...fier.escape.php
Jake Stride wrote:
> Is there a way to have smarty automatically replace all html entites in
> variable in a template?
>
> Ie
>
> Code:
>
> $smarty->assign("someVar", "One & one");
>
> Template
>
> {$someVar}
>
> Would become
>
> One & one?
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com