| Jed R. Brubaker 2004-11-04, 8:57 pm |
| This one should be easy. I am certain that I am missing something.
I have a SmartyConfig class that extends Smarty and sets application level
variables (directories, security, etc.).
I am now trying to create a block that simply avoids caching, but I would
like to have it somewhere in my SmartyConfig class.
If I have it in the constructor, I get this error:
{nocache:af0e435caa9a7868f76ea427d2429a7
9#0}
Fatal error: Non-static method SmartyConfig::noCache_block() cannot be
called statically in
c:\web\www\smarty\compile\%%31^31B^31BB5
478%%featuredTitles.tpl.php on line
5
If I have it in the class but not in the constuctor, I get this error:
Fatal error: Smarty error: [in email/featuredTitles.tpl line 1]:
[plugin] block 'noCache' is not implemented (core.load_plugins.php, line 36)
in c:\web\www\php\classes\smarty\Smarty.class.php on line 1088
The only way I have been able to get it to work is if the function is
defined outisde a class. I am pretty sure this is because the function needs
to be global. Is there anyway to make that not be? Can I create a block
wholly inside a class? How wouldthe register_block() look?
Thanks!
|