function edit() { DB::escapePost(); if ($_POST) { Codes::editCodesType(); $this->redirect('/codes/'); } else { $data = Codes::getType($_GET['id']); View::plugin('add', $data); } }