/** * Deletes files in user's directory and * clears all in DB */ public function actionDeleteall() { $model = new Files(); $pathToDir = '../upload/' . Yii::$app->user->identity['login']; self::cleanDirectory($pathToDir); $model->clearDataUser(); $this->goHome(); }