function destroy($params) { if (empty($params['id'])) { bail('Required param["id"] not set.'); } $note = new note($params['id']); $note->destroy(); $this->redirectTo(array('controller' => 'Note', 'action' => 'index')); }