Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
smarty_modifier_escape and smarty_modifiercompiler_escape

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Thu Jul 19, 2012 7:18 am    Post subject: smarty_modifier_escape and smarty_modifiercompiler_escape Reply with quote

Why do you have two plugins for "escape" modifier? Just curious.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Thu Jul 19, 2012 11:13 am    Post subject: Reply with quote

smarty_modifier_* are functions exected at template evaluation. smarty_modifiercompiler:* are function executed at template compilation.

the latter produces PHP-code that is written to the compiled template file. This allows us to inject simple modifers directly into the source, rather than having them wrapped in a function that's called at runtime.

While both plugins essentially do the same, the modifiercompiler can avoid loading a plugin source file and skips at least one entry to the function stack.
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 4587
Location: Hamburg / Germany

PostPosted: Thu Jul 19, 2012 9:51 pm    Post subject: Reply with quote

The none compiling version of the escape modifier is a fallback for older PHP versions where the htmlspecialchars() function did not have the $double_encode parameter.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP