public function excluir_template() { if ($_SERVER['REQUEST_METHOD'] == "POST") { try { // View::validarHashIdLink($this->input->post('idData')); $template = new Template(); $template->set_pk_template((int) $this->input->post('idData')); $template->excluir_template(); echo json_encode(array('msg' => '<p class="alert ok">Registro excluído com sucesso!</p>')); } catch (Exception $e) { echo json_encode(array('erro' => '<p class="alert erro">Erro ao excluir a registro!</p>')); } } return false; }