‪TYPO3CMS  9.5
ArgumentTestController.php
Go to the documentation of this file.
1 <?php
2 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 
24 
29 {
35  protected ‪$forwardTargetAction;
36 
43 
44  public function ‪declareForwardTargetAction(string ‪$forwardTargetAction): void
45  {
46  $this->forwardTargetAction = ‪$forwardTargetAction;
47  }
48 
50  {
51  $this->forwardTargetArguments = ‪$forwardTargetArguments;
52  }
53 
55  {
56  if (‪$view instanceof ‪TemplateView) {
57  // assign template path directly without forging external configuration for that...
58  ‪$view->getTemplatePaths()->setTemplateRootPaths([dirname(__DIR__) . '/Templates']);
59  }
60  }
61 
62  protected function ‪addErrorFlashMessage()
63  {
64  // ignore flash messages
65  }
66 
67  public function ‪forwardAction(): void
68  {
69  $this->‪forward(
70  $this->forwardTargetAction,
71  null,
72  null,
73  $this->forwardTargetArguments
74  );
75  }
76 
80  public function ‪inputPresetModelAction(Model $preset): void
81  {
82  $model = new Model();
83  $model->setValue($preset->getValue());
84  $this->view->assignMultiple([
85  'model' => $model,
86  ]);
87  }
88 
92  public function ‪inputPresetDtoAction(ModelDto $preset): void
93  {
94  $dto = new ModelDto();
95  $dto->setValue($preset->getValue());
96  $this->view->assignMultiple([
97  'dto' => $dto,
98  ]);
99  }
100 
105  public function ‪validateModelAction($model): void
106  {
107  // rendered in template `InputPresetModel.html`
108  }
109 
114  public function ‪validateDtoAction($dto): void
115  {
116  // rendered in template `InputPresetDto.html`
117  }
118 }
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\inputPresetModelAction
‪inputPresetModelAction(Model $preset)
Definition: ArgumentTestController.php:78
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\forwardAction
‪forwardAction()
Definition: ArgumentTestController.php:65
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\$view
‪ViewInterface $view
Definition: ActionController.php:44
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\$forwardTargetAction
‪string $forwardTargetAction
Definition: ArgumentTestController.php:34
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\validateDtoAction
‪validateDtoAction($dto)
Definition: ArgumentTestController.php:112
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller
Definition: ArgumentTestController.php:3
‪TYPO3\CMS\Fluid\View\TemplateView
Definition: TemplateView.php:24
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\Model\getValue
‪string getValue()
Definition: Model.php:36
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\declareForwardTargetArguments
‪declareForwardTargetArguments(array $forwardTargetArguments)
Definition: ArgumentTestController.php:47
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController
Definition: ArgumentTestController.php:29
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\$forwardTargetArguments
‪array $forwardTargetArguments
Definition: ArgumentTestController.php:40
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\setViewConfiguration
‪setViewConfiguration(ViewInterface $view)
Definition: ArgumentTestController.php:52
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\inputPresetDtoAction
‪inputPresetDtoAction(ModelDto $preset)
Definition: ArgumentTestController.php:90
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\Model
Definition: Model.php:24
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface
Definition: ViewInterface.php:21
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\declareForwardTargetAction
‪declareForwardTargetAction(string $forwardTargetAction)
Definition: ArgumentTestController.php:42
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\ModelDto\getValue
‪string getValue()
Definition: ModelDto.php:34
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\addErrorFlashMessage
‪addErrorFlashMessage()
Definition: ArgumentTestController.php:60
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
Definition: ActionController.php:31
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Domain\Model\ModelDto
Definition: ModelDto.php:22
‪TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller\Fixture\Controller\ArgumentTestController\validateModelAction
‪validateModelAction($model)
Definition: ArgumentTestController.php:103
‪TYPO3\CMS\Extbase\Mvc\Controller\AbstractController\forward
‪forward($actionName, $controllerName=null, $extensionName=null, array $arguments=null)
Definition: AbstractController.php:247