/** * Delete widget and activated widgets. * * @param $id string * * @return \yii\web\Response */ public function actionDeleteWidget($id) { FileHelper::removeDirectory($this->_widgetDir . $id); Widget::deleteAll('widget_dir=:widget_dir', ['widget_dir' => $id]); return $this->redirect(['index']); }