public function RemoveIMGAction() { $this->path = '/upload/web/news/'; $id = $this->request->getPost('id'); $name = $this->request->getPost('name'); $data = WebNews::findFirst('id=' . $id); $data->upload = str_replace($name . ',', '', $data->upload); if ($data->save() && unlink($this->root . $this->path . $name) == TRUE) { return $this->response->setJsonContent(array('status' => 'ok')); } else { return $this->response->setJsonContent(array('status' => 'no')); } }