‪TYPO3CMS  10.4
ArgumentTestController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
26 
31 {
37  protected ‪$forwardTargetAction;
38 
45 
46  public function ‪declareForwardTargetAction(string ‪$forwardTargetAction): void
47  {
48  $this->forwardTargetAction = ‪$forwardTargetAction;
49  }
50 
52  {
53  $this->forwardTargetArguments = ‪$forwardTargetArguments;
54  }
55 
57  {
58  if (‪$view instanceof ‪TemplateView) {
59  // assign template path directly without forging external configuration for that...
60  ‪$view->getTemplatePaths()->setTemplateRootPaths([dirname(__DIR__) . '/Templates']);
61  }
62  }
63 
64  protected function ‪addErrorFlashMessage()
65  {
66  // ignore flash messages
67  }
68 
69  public function ‪forwardAction(): void
70  {
71  $this->‪forward(
72  $this->forwardTargetAction,
73  null,
74  null,
75  $this->forwardTargetArguments
76  );
77  }
78 
82  public function ‪inputPresetModelAction(‪Model $preset): void
83  {
84  $model = new ‪Model();
85  $model->setValue($preset->‪getValue());
86  $this->view->assignMultiple([
87  'model' => $model,
88  ]);
89  }
90 
94  public function ‪inputPresetDtoAction(‪ModelDto $preset): void
95  {
96  $dto = new ‪ModelDto();
97  $dto->setValue($preset->‪getValue());
98  $this->view->assignMultiple([
99  'dto' => $dto,
100  ]);
101  }
102 
107  public function ‪validateModelAction($model): void
108  {
109  // rendered in template `InputPresetModel.html`
110  }
111 
116  public function ‪validateDtoAction($dto): void
117  {
118  // rendered in template `InputPresetDto.html`
119  }
120 }
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\inputPresetModelAction
‪inputPresetModelAction(Model $preset)
Definition: ArgumentTestController.php:80
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\forwardAction
‪forwardAction()
Definition: ArgumentTestController.php:67
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\forward
‪forward($actionName, $controllerName=null, $extensionName=null, array $arguments=null)
Definition: ActionController.php:815
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:18
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$view
‪ViewInterface $view
Definition: ActionController.php:76
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\$forwardTargetAction
‪string $forwardTargetAction
Definition: ArgumentTestController.php:36
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\validateDtoAction
‪validateDtoAction($dto)
Definition: ArgumentTestController.php:114
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller
Definition: ArgumentTestController.php:18
‪TYPO3\CMS\Fluid\View\TemplateView
Definition: TemplateView.php:25
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\Model\getValue
‪string getValue()
Definition: Model.php:38
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\declareForwardTargetArguments
‪declareForwardTargetArguments(array $forwardTargetArguments)
Definition: ArgumentTestController.php:49
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController
Definition: ArgumentTestController.php:31
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\$forwardTargetArguments
‪array $forwardTargetArguments
Definition: ArgumentTestController.php:42
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\setViewConfiguration
‪setViewConfiguration(ViewInterface $view)
Definition: ArgumentTestController.php:54
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\inputPresetDtoAction
‪inputPresetDtoAction(ModelDto $preset)
Definition: ArgumentTestController.php:92
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\Model
Definition: Model.php:26
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface
Definition: ViewInterface.php:24
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\declareForwardTargetAction
‪declareForwardTargetAction(string $forwardTargetAction)
Definition: ArgumentTestController.php:44
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\ModelDto\getValue
‪string getValue()
Definition: ModelDto.php:36
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\addErrorFlashMessage
‪addErrorFlashMessage()
Definition: ArgumentTestController.php:62
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
Definition: ActionController.php:55
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\ModelDto
Definition: ModelDto.php:24
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\validateModelAction
‪validateModelAction($model)
Definition: ArgumentTestController.php:105