smarty block - defining the function

From: Date: Thu, 04 Nov 2004 20:44:52 +0000
Subject: smarty block - defining the function
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11947@lists.php.net to get a copy of this message
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:af0e435caa9a7868f76ea427d2429a79#0} Fatal error: Non-static method SmartyConfig::noCache_block() cannot be called statically in c:\web\www\smarty\compile\%%31^31B^31BB5478%%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!

« previous php.smarty.general (#11947) next »