This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 
<?php
defined('C5_EXECUTE') or die("Access Denied.");

class Concrete5_Controller_Dashboard_System_Optimization_ClearCache extends DashboardBaseController {
    
    public $helpers = array('form'); 
    
    public function view(){
    }
    
    public function do_clear() {
        if ($this->token->validate("clear_cache")) {
            if ($this->isPost()) {
                Cache::flush();
                $this->redirect('/dashboard/system/optimization/clear_cache', 'cache_cleared');
            }
        } else {
            $this->set('error', array($this->token->getErrorMessage()));
        }
    }

    public function cache_cleared() {
        $this->set('message', t('Cached files removed.'));  
        $this->view();
    }
    
    
}