Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Add getView and getRequest to event #1169

Open
wants to merge 2 commits into
base: typo3-v12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Classes/Controller/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException;
use TYPO3\CMS\Extbase\Http\ForwardResponse;
use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException;
use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException;
use TYPO3\CMS\Extbase\Persistence\Exception\UnknownObjectException;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use TYPO3Fluid\Fluid\View\ViewInterface;

/**
* Class FormController
Expand All @@ -64,6 +66,16 @@ class FormController extends AbstractController
*/
protected DataProcessorRunner $dataProcessorRunner;

public function getView(): ?ViewInterface
{
return $this->view;
}

public function getRequest(): ?RequestInterface
{
return $this->request;
}

/**
* @return ResponseInterface
* @noinspection PhpUnused
Expand Down
12 changes: 12 additions & 0 deletions Classes/Events/FormControllerFormActionEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

use In2code\Powermail\Controller\FormController;
use In2code\Powermail\Domain\Model\Form;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
use TYPO3Fluid\Fluid\View\ViewInterface;

final class FormControllerFormActionEvent
{
Expand Down Expand Up @@ -53,4 +55,14 @@ public function getFormController(): FormController
{
return $this->formController;
}

public function getView(): ?ViewInterface
{
return $this->getFormController()->getView();
}

public function getRequest(): ?RequestInterface
{
return $this->getFormController()->getRequest();
}
}