Smarty::clearCache PHP Метод

clearCache() публичный Метод

Empty cache for a specific template
public clearCache ( string $template_name, string $cache_id = null, string $compile_id = null, integer $exp_time = null, string $type = null ) : integer
$template_name string template name
$cache_id string cache id
$compile_id string compile id
$exp_time integer expiration time
$type string resource type
Результат integer number of cache files deleted
    public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
    {
        // load cache resource and call clear
        $_cache_resource = Smarty_CacheResource::load($this, $type);
        Smarty_CacheResource::invalidLoadedCache($this);
        return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time);
    }

Usage Example

Пример #1
0
 /**
  * Expires the cache
  *
  * @param boolean $expireAll expire the whole cache
  */
 public function CacheExpire($expireAll = false)
 {
     if ($expireAll) {
         $this->tpl->clearAllCache();
         return;
     }
     if (!$this->project) {
         return;
     }
     $epoch = $this->GetProject()->GetEpoch();
     if (empty($epoch)) {
         return;
     }
     $age = $this->GetProject()->GetAge();
     $this->tpl->clearCache(null, $this->GetCacheKeyPrefix(), null, $age);
     $this->tpl->clearCache('projectlist.tpl', $this->GetCacheKeyPrefix(false), null, $age);
 }
All Usage Examples Of Smarty::clearCache