Re: [SMARTY] modifier_string_format in 2.5.0-RC1
| From: | Paul Lockaby | Date: | Thu, 06 Mar 2003 15:59:50 +0000 |
| Subject: | Re: [SMARTY] modifier_string_format in 2.5.0-RC1 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8450@lists.php.net to get a copy of this message | ||
Monte Ohrt wrote:
You're right, this is fixed in CVS for the official 2.5.0 release. This was erroneously swapped in CVS, so it was right some time back. Thanks MonteExcept that the version you just committed doesn't work, atleast not for me! My script looks like this: {assign var="foo" value="test %s"} {assign var="bar" value="hello"} {$foo|string_format:$bar} That works with the previous version, but not with the most recently committed version. However, I find that the best way to use sprintf is to register it as a modifier like so: $smarty->register_modifier("string_format","sprintf"); Then you can pass as many arguments to it as you want, just like if you had direct access to it. ~Paul