rest = $rest; $this->header = $header; $this->businessLogicProcessor = $businessLogicProcessor; } public function process() { try { $id = $this->rest->get('id'); } catch (RestException $e) { return "Page ID not specified"; } $result = $this->businessLogicProcessor->processSubmit($id); if(isset($result['error'])) { $_SESSION['error'] = $result; } $redirectUrl = "/"; if(isset($result['redirect'])) { $redirectUrl = $result['redirect']; } $this->header->location($redirectUrl); } }