/** * * Process submitted form values */ protected function process() { $formVals = $this->Form->getSubmittedValues(); d('formVals: ' . print_r($formVals, 1)); $oAdapter = new QuestionParser($this->Registry); try { $Question = $oAdapter->parse(new SubmittedQuestionWWW($this->Registry, $formVals)); d('cp created new question'); d('title: ' . $Question['title']); Responder::redirectToPage($Question->getUrl()); } catch (QuestionParserException $e) { $this->Form->setFormError($e->getMessage()); $this->showFormWithErrors(); } }
/** * * Process submitted form values * and create the $this->Question object */ protected function process() { $oAdapter = new QuestionParser($this->Registry); try { $this->Question = $oAdapter->parse($this->Submitted); d('cp created new question'); d('title: ' . $this->Question['title']); } catch (\Lampcms\QuestionParserException $e) { $err = $e->getMessage(); d('$err: ' . $err); throw new \Lampcms\HttpResponseCodeException($err, 400); } return $this; }