| @@ 623-632 (lines=10) @@ | ||
| 620 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 621 | $viewModel = $this->buildView($this->game); |
|
| 622 | ||
| 623 | if ($this->getRequest()->isPost()) { |
|
| 624 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 625 | $form->setData($data); |
|
| 626 | if ($form->isValid()) { |
|
| 627 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 628 | if ($result) { |
|
| 629 | $statusMail = true; |
|
| 630 | } |
|
| 631 | } |
|
| 632 | } |
|
| 633 | ||
| 634 | $viewModel->setVariables(array( |
|
| 635 | 'statusMail' => $statusMail, |
|
| @@ 940-949 (lines=10) @@ | ||
| 937 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 938 | $form->setAttribute('method', 'post'); |
|
| 939 | ||
| 940 | if ($this->getRequest()->isPost()) { |
|
| 941 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 942 | $form->setData($data); |
|
| 943 | if ($form->isValid()) { |
|
| 944 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 945 | if ($result) { |
|
| 946 | $statusMail = true; |
|
| 947 | } |
|
| 948 | } |
|
| 949 | } |
|
| 950 | ||
| 951 | $viewModel = $this->buildView($this->game); |
|
| 952 | ||