Project

General

Profile

Actions

Task #63643

closed

Story #63642: Introduce Request/Response model for frontend rendering

Use Request Response model in JsonView

Added by Helmut Hummel almost 10 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-12-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Epic #92512: PSR-7 Request/Response handling in ExtbaseClosed2020-10-08

Actions
Actions #1

Updated by Mathias Schreiber almost 7 years ago

do you mean PSR7 responses here?

Actions #2

Updated by Helmut Hummel almost 7 years ago

at the time of writing, there was no psr7 yet.
But yes, a response object might be based on
psr7 nowadays.

Point is to not directly send headers in the view object,
but add the headers to any type of response object instead.

Actions #3

Updated by Mathias Brodala over 6 years ago

  • Sprint Focus set to On Location Sprint
Actions #4

Updated by Mathias Brodala over 6 years ago

  • Sprint Focus deleted (On Location Sprint)

Not doing this now since PSR-7 request/response is vastly different from Extbase request/response.

Actions #5

Updated by Christian Eßl over 4 years ago

  • Category set to Extbase
Actions #6

Updated by Alexander Schnitzler about 4 years ago

Making JsonView use Request/Response is not that easily possible without changing the ViewInterface in general since method render() must return a string. Still, this bug report is totally valid and must be addressed. My idea is as follows:

Make every action return a ResponseInterface and make the user do something like this:

$response = new Response($this->view->render());
$response->setHeader('Content-Type', 'application/json');

Unfortunately we need people to set headers manually outside the JsonView or we let them use the core JsonResponse which does the job for them. But setting headers in the view is a no go indeed.

Actions #7

Updated by Alexander Schnitzler about 4 years ago

  • Related to Epic #92512: PSR-7 Request/Response handling in Extbase added
Actions #8

Updated by Christian Kuhn almost 3 years ago

  • Status changed from New to Closed

If I understand the issue correctly, we addressed this in v11 in a slightly different way: jsonview renders the json_encode'd string, ActionController->jsonResponse() can be used to create a response with appropriate headers from it.

I'll close the issue for now since I think it's resolved. Re-open or create a new one if anyone disagrees.

Actions

Also available in: Atom PDF