Skip to content

Instantly share code, notes, and snippets.

public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$website = $this->Websites->get($id);
if ($this->Websites->delete($website)) {
$this->Flash->success(__('The website has been deleted.'));
} else {
$this->Flash->error(__('The website could not be deleted. Please, try again.'));