function del() { $model = new Reference(); $model->del(); if ($_GET['parent'] != 0) { $this->redirect('/reference/' . $_GET['parent'] . '/'); } else { $this->redirect('/reference/'); } }