|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Grigori Smarty Rookie
Joined: 21 Dec 2011 Posts: 10
|
Posted: Tue Jun 26, 2012 8:05 am Post subject: filter or documentation error |
|
|
I follow the documentation
http://www.smarty.net/v3_overview
and write
Code: | $smarty->registerFilter('variable','htmlspecialchars'); |
It gives me an error:
Quote: |
PHP warning
htmlspecialchars() expects parameter 2 to be long, object given
<?php echo htmlspecialchars($foo,$_smarty_tpl);?>
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jun 26, 2012 7:36 pm Post subject: |
|
|
This is an error in documentation.
registerFilter('variable', ...) does register a callback which must have same parameters as the 'pre','post' and 'output' filters. It does not replace the default template modifier. |
|
Back to top |
|
Grigori Smarty Rookie
Joined: 21 Dec 2011 Posts: 10
|
|
Back to top |
|
|
|
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
|