Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

minor addon clear function for handling "sports&bas

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
mumuri
Smarty Rookie


Joined: 06 Apr 2008
Posts: 27

PostPosted: Sun May 11, 2008 7:57 pm    Post subject: minor addon clear function for handling "sports&bas Reply with quote

instead of this

Code:
$smarty->clear_cache(null,'sports');
$smarty->clear_cache(null,'basketball');


you can do this
Code:
$smarty->clear(null,"sports&basketball");



Code:
 function clear($template=null, $cache_ids=null, $compile_id=null, $expire=null)
    {
       $cache_ids=split("&",$cache_ids);
       foreach ($cache_ids as $cache_id){
          $this->clear_cache($template, $cache_id, $compile_id, $expire);
       }
    }



see manual/en/caching.groups.php
Code:
$smarty->clear_cache(null,'sports|basketball');

delete sports|basketball|*

Code:
$smarty->clear_cache(null,'sports&basketball');

delete sports|* and basketball|*
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP