Smarty::clearAllCache PHP Method

clearAllCache() public method

Empty cache folder
public clearAllCache ( integer $exp_time = null, string $type = null ) : integer
$exp_time integer expiration time
$type string resource type
return integer number of cache files deleted
    public function clearAllCache($exp_time = null, $type = null)
    {
        // load cache resource and call clearAll
        $_cache_resource = Smarty_CacheResource::load($this, $type);
        Smarty_CacheResource::invalidLoadedCache($this);
        return $_cache_resource->clearAll($this, $exp_time);
    }

Usage Example

Example #1
0
 public function render($name, array $values = array())
 {
     if (defined('ENV_DEV')) {
         //$this->engine->clearCacheFiles();
         //$this->engine->clearTemplateCache();
         $this->engine->clearAllCache();
         $this->engine->clearCompiledTemplate();
     }
     $template = $this->engine->createTemplate($name . $this->suffix);
     $template->assign($values);
     return $template->fetch();
 }
All Usage Examples Of Smarty::clearAllCache