예제 #1
0
 public function actionIndex()
 {
     $model = new CacheForm();
     if (LuLu::$app->request->isPost && $model->load(LuLu::$app->request->post())) {
         if ($model->cache) {
             LuLu::flushCache();
             LuLu::$app->schemaCache->flush();
         }
         if ($model->asset) {
             $assetDir = LuLu::getAlias('@statics/assets');
             FileHelper::removeDirectoryContent($assetDir);
         }
         return $this->redirect(['index']);
     }
     return $this->render('index', ['model' => $model]);
 }