[!!!][TASK] Remove deprecated code from TableController
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / 9.5 / Deprecation-84196-BackendControllerActionsDoNotReceivePreparedResponse.rst
1 .. include:: ../../Includes.txt
2
3 =================================================================================
4 Deprecation: #84196 - Backend controller actions do not receive prepared response
5 =================================================================================
6
7 See :issue:`84196`
8
9 Description
10 ===========
11
12 The second argument to backend and eID controller actions has been marked as deprecated.
13 Controllers should create a response object implementing
14 :php:`Psr\Http\Message\ResponseInterface` on their own instead of relying
15 on a prepared response.
16
17 The signature of controller actions should look like
18
19 .. code-block:: php
20
21 public function myAction(ServerRequestInterface $request): ResponseInterface
22
23 Impact
24 ======
25
26 Controllers should typically instantiate one of the three core response classes
27 and return it:
28
29 .. code-block:: php
30
31 public function myAction(ServerRequestInterface $request): ResponseInterface
32 {
33 return new HtmlResponse('content');
34 return new JsonResponse($jsonArray);
35 return new RedirectResponse($url);
36 }
37
38 Affected Installations
39 ======================
40
41 Instances with extensions that register backend controllers (eg. modules) or eID
42 may be affected.
43
44 The dynamic scanning for not yet adapted controller actions relies on reflection and
45 costs some CPU cycles. If all affected extensions have been adapted, the feature toggle
46 :php:`simplifiedControllerActionDispatching` should be enabled. This can be managed in
47 the backend Settings -> Configure Installation-Wide Options module.
48
49
50 Migration
51 =========
52
53 See above code examples for typical controller actions return values and signature.
54
55 .. index:: Backend, PHP-API, NotScanned