[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-general
Subject:    [SMARTY] smarty block - defining the function
From:       65.100.199.113
Date:       2004-11-04 20:44:52
Message-ID: 20041104205612.45596.qmail () pb1 ! pair ! com
[Download RAW message or body]

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!

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic