|
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 |
Jerc Smarty Rookie
Joined: 26 Jan 2010 Posts: 30 Location: Slovenia / Ljubljana
|
Posted: Fri May 23, 2014 1:03 pm Post subject: Static function, unknown modifier |
|
|
I have a tiny problem with my template and I'm not sure if this is a Smarty bug or I just made a mistake in the code.
PHP
Code: |
// class
namespace WK;
class Utf {
public static toUtf($str) { return $str; }
}
// code
$smarty->registerClass('Utf', 'WK\Utf');
$smarty->assign('now', time());
|
.tpl
Code: |
{$now|date_format:"%A, %B %e, %Y"|Utf::toUtf8}
|
Exception:
unknown modifier "Utf" <-- thrown in D:\wamp\www\mojekarte-dev-krv\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 51
Then i tried with a function toUtf (without class, namespace...) and replace |Utf::toUtf8} with |toUtf} no exception is returned.
Tested on: 3.1.18
Thanks |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
Jerc Smarty Rookie
Joined: 26 Jan 2010 Posts: 30 Location: Slovenia / Ljubljana
|
Posted: Mon May 26, 2014 5:38 am Post subject: |
|
|
It's working!
Thanks. |
|
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
|