function cacheView($controller, $action, $path, $page) { if (Configure::read('Cache.enable') && Configure::read('Cache.view')) { if (file_exists(S2Paths::get($this->app, 'S2_THEMES') . $this->viewTheme . DS . $controller . DS . $action . $this->viewSuffix . '.thtml')) { $viewFileName = S2Paths::get($this->app, 'S2_THEMES') . $this->viewTheme . DS . $controller . DS . $action . $this->viewSuffix . '.thtml'; } elseif (file_exists(S2Paths::get($this->app, 'S2_THEMES') . $this->viewTheme . DS . $controller . DS . $action . '.thtml')) { $viewFileName = S2Paths::get($this->app, 'S2_THEMES') . $this->viewTheme . DS . $controller . DS . $action . '.thtml'; } elseif (file_exists(S2Paths::get($this->app, 'S2_THEMES') . 'default' . DS . $controller . DS . $action . $this->viewSuffix . '.thtml')) { $viewFileName = S2Paths::get($this->app, 'S2_THEMES') . $this->viewTheme . DS . $controller . DS . $action . '.thtml'; } elseif (file_exists(S2Paths::get($this->app, 'S2_THEMES') . 'default' . DS . $controller . DS . $action . '.thtml')) { $viewFileName = S2Paths::get($this->app, 'S2_THEMES') . 'default' . DS . $controller . DS . $action . '.thtml'; } App::import('Helper', 'Cache'); $Cache = new CacheHelper(); $Cache->app = $this->app; $Cache->here = $path; $Cache->cacheAction = Configure::read('Cache.expires'); $Cache->cache($viewFileName, $page, true, $this->autoRender); } }