public function delete() { if ($this->f3->exists('PARAMS.tok')) { //get id getIdByTok $getIdByTok = new Cat($this->db); $getIdByTok->getIdByTok($this->f3->get('PARAMS.tok')); $cid = $this->f3->get('ID.id'); $item = new Item($this->db); $this->f3->set('POST.cid', 0); $item->deleteCat($this->f3->get('PARAMS.tok')); $category = new Cat($this->db); $category->delete($this->f3->get('PARAMS.tok')); } $this->f3->reroute('/c'); }