I'd like to set a message that prints a confirmation for the user, i.e.:
"Thank you for deleting XYZ".
At the moment my delete() method looks like this:
public function delete($id) {
if ($this->request->is('get')) {
throw new MethodNotAllowedException();
}
if ($this->Product->delete($id)) {
echo "<pre>";
echo "id: " . $id;
print_r($this->Product->find('all',
array("condition",
array("Product.id" => $id)
)
)
);
echo "</pre>";
}
}
However, the print_r() statement shows all products, and the one delete is missing - which I assume is the right behaviour. How can I get the name of the item just deleted?