Re[2]: [SMARTY] htmlentities to all assigned variables

From: Date: Wed, 15 Jan 2003 19:06:35 +0000
Subject: Re[2]: [SMARTY] htmlentities to all assigned variables
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7201@lists.php.net to get a copy of this message
Hi, > On Wed, Jan 15, 2003 at 07:59:50PM +0200, Alex wrote: >> Hi! >> I have a following problem: >> I need to apply htmlentities() function to all assigned variables. >> I know I can use {$AnyVar|escape} but for this I need to remake a huge >> template's files. I tried to find any solution with plugins, but I >> couldn't. Now I have several solution but none of them not looks good. >> For example I can make Smarty child class and overload assign() >> function. >> Anybody have any ideas? > all the assigned template-vars are in an associative array in $smarty->>_tpl_vars > if you do not assign and modify them inside you template, you can > modify them all assigned ones before your call to display() or > fetch(): I thought about this way but I have a lot of php files with display() calls. It's not hard for me to do this, but I am interested to find easier way. Besides $smarty->_tpl_vars is "private" variable :) Alex.

« previous php.smarty.general (#7201) next »