Actions
Feature #101124
openMake Templates optional in Extbase
Status:
Needs Feedback
Priority:
Should have
Assignee:
Category:
Extbase
Target version:
Start date:
2023-06-20
Due date:
% Done:
0%
Estimated time:
PHP Version:
8.2
Tags:
extbase, JsonResponse, HtmlResponse, view, template
Complexity:
Sprint Focus:
Description
Since ResponseInterface has been introduced, one can define a return type, JsonResponse , HtmlResponse etc.
The problem here is that using for example JsonResponse with Extbase and not defining a template for it, TYPO3 throws an exception. Now, we have to add a template and format it to a json structure which could be PITA, specially when the JSON is huge. One could use Middlewares , but with TYPO3 12, one can not use Extbase features if not in Extbase context. So now we are in a dead end.
Solution
Make the template requirement optional, or add a method which deactivates it for the action, like
$this->view->withTemplate(false);
Files
Actions