public function createAction() { if ($this->getRequest()->isPost()) { $this->contactForm->setData($this->getRequest()->getPost()); if ($this->contactForm->isValid()) { $person = $this->contactService->createPerson($this->contactForm->getData()); return $this->redirect()->toRoute('contacts/view', ['type' => ContactEntry::TYPE_PERSON, 'id' => $person->getId()->toString()]); } } return new ViewModel(['contactForm' => $this->contactForm]); }