public function action_delete($id = null) { is_null($id) and Response::redirect('department'); if ($department = Model_Department::find($id)) { $department->delete(); Session::set_flash('success', 'Deleted department #' . $id); } else { Session::set_flash('error', 'Could not delete department #' . $id); } Response::redirect('department'); }