function actionCache() { $dataList = array('pageCache' => '页面缓存', 'dataCache' => '数据缓存', 'allCache' => '全部缓存'); // ppr($dataList); $notice = '选择缓存类型'; if (XUtils::method() == 'POST') { $cacheType = reqPost('cacheType', NULL); $path = SITE_BACKEND_PATH . 'assets'; switch ($cacheType) { case 'pageCache': XUtils::delDirAndFile($path); break; case 'dataCache': cacheFlush(); break; case 'allCache': cacheFlush(); XUtils::delDirAndFile($path); break; } $notice .= '<br />清空完成!'; } $this->render('cache', array('dataList' => $dataList, 'notice' => $notice)); }