/** * @param integer $id * * @return string * * @throws \Exception */ public function actionDelete($id) { try { /** @var Widget $widget */ $widget = Widget::findOne(['id' => $id]); $widget->delete(); } catch (Exception $e) { } $widgets = Widget::find()->all(); return $this->renderAjax('admin/widgets.tpl', ['widgets' => $widgets]); }
/** * @return mixed */ public function actionIndex() { $widgets = Widget::find()->all(); $finder = new Finder(); return $this->render('admin/index.tpl', ['widgets' => $widgets, 'finder' => $finder]); }