/** * Deletes an existing Priskhead model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param string $id * @return mixed */ public function actionDelete($id) { $model = $this->findModel($id); //remove upload file & data $this->removeUploadDir($model->ref); Uploadsp::deleteAll(['ref' => $model->ref]); $model->delete(); return $this->redirect(['index']); }