| @@ 660-669 (lines=10) @@ | ||
| 657 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 658 | $viewModel = $this->buildView($this->game); |
|
| 659 | ||
| 660 | if ($this->getRequest()->isPost()) { |
|
| 661 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 662 | $form->setData($data); |
|
| 663 | if ($form->isValid()) { |
|
| 664 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 665 | if ($result) { |
|
| 666 | $statusMail = true; |
|
| 667 | } |
|
| 668 | } |
|
| 669 | } |
|
| 670 | ||
| 671 | $viewModel->setVariables( |
|
| 672 | [ |
|
| @@ 1015-1024 (lines=10) @@ | ||
| 1012 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 1013 | $form->setAttribute('method', 'post'); |
|
| 1014 | ||
| 1015 | if ($this->getRequest()->isPost()) { |
|
| 1016 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 1017 | $form->setData($data); |
|
| 1018 | if ($form->isValid()) { |
|
| 1019 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 1020 | if ($result) { |
|
| 1021 | $statusMail = true; |
|
| 1022 | } |
|
| 1023 | } |
|
| 1024 | } |
|
| 1025 | ||
| 1026 | $viewModel = $this->buildView($this->game); |
|
| 1027 | ||