|
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 |
johndoe1395 Smarty n00b
Joined: 13 Apr 2013 Posts: 4
|
Posted: Sat Apr 13, 2013 9:22 pm Post subject: Smarty cannot call filters that are static members |
|
|
Hello everyone
I registered an output filter with
$this->registerFilter("output", "ClassName::functionName");
and although this works with blocks and custom functions it throws a "call to undefined function" error when used with filters.
A quick fix would be replacing line 60 with
$output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template); |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Apr 14, 2013 6:20 am Post subject: |
|
|
The valid PHP callback for a statict class is an array of class and method name.
Code: | $this->registerFilter("output", array("ClassName","functionName")); |
|
|
Back to top |
|
johndoe1395 Smarty n00b
Joined: 13 Apr 2013 Posts: 4
|
Posted: Mon Apr 15, 2013 8:28 pm Post subject: |
|
|
Nice, 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
|