‪TYPO3CMS  9.5
AbstractModule.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
21 
31 {
37  protected ‪$moduleTemplate;
38 
42  public function ‪__construct()
43  {
44  trigger_error(
45  'Class AbstractModule is deprecated since TYPO3 v9 and will be removed with TYPO3 v10.0.'
46  . ' Instantiate ModuleTemplate yourself if needed and use routing registered in Routes.php.',
47  E_USER_DEPRECATED
48  );
49  $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
50  }
51 
57  protected ‪$request;
58 
69  public function ‪processRequest(ServerRequestInterface ‪$request, ResponseInterface $response)
70  {
71  $methodName = ‪$request->getQueryParams()['action'] ?: 'index';
72  if (!is_callable([$this, $methodName])) {
73  throw new \InvalidArgumentException(
74  'The method "' . $methodName . '" is not callable within "' . static::class . '".',
75  1442736343
76  );
77  }
78  return $this->{$methodName}(‪$request, $response);
79  }
80 }
‪TYPO3\CMS\Backend\Module\AbstractModule
Definition: AbstractModule.php:31
‪TYPO3\CMS\Backend\Template\ModuleTemplate
Definition: ModuleTemplate.php:40
‪TYPO3\CMS\Backend\Module\AbstractModule\processRequest
‪ResponseInterface processRequest(ServerRequestInterface $request, ResponseInterface $response)
Definition: AbstractModule.php:67
‪TYPO3\CMS\Backend\Module\AbstractModule\$moduleTemplate
‪ModuleTemplate $moduleTemplate
Definition: AbstractModule.php:36
‪TYPO3\CMS\Backend\Module\AbstractModule\$request
‪ServerRequestInterface $request
Definition: AbstractModule.php:55
‪TYPO3\CMS\Backend\Module\AbstractModule\__construct
‪__construct()
Definition: AbstractModule.php:41
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Backend\Module
Definition: AbstractFunctionModule.php:2