/** * Recebe um id de usuário via POST e deleta do banco de dados */ public function deleteUserAction() { $this->view->disable(); $user_id = intval($this->request->getPost('user_id')); $user_blog = UserBlog::findFirstByUser_id($user_id); $delete = !$user_blog ? true : $user_blog->delete(); $user = Users::findFirstByUser_id($user_id); $data['success'] = $delete ? $user->delete() : $delete; echo json_encode($data); }