public function rm($id) { if (!$id) { return; } $this->can(TinyMvc::App()->controller . '/rm', $id); $model = new $this->modelName(); $model = $model::byId($id); $model->delete(); $this->flash("Changes were saved", "success"); $this->redirect($this->successUrl); }