/** * Deletes an existing Goods model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $model = $this->findModel($id); \common\models\UploadHelpers::deleteFile($model->picture, Yii::$app->basePath . '/web/uploads'); $model->delete(); return $this->redirect(['index']); }