‪TYPO3CMS  10.4
TYPO3\CMS\Extbase\Mvc\Response Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Response:
TYPO3\CMS\Extbase\Mvc\ResponseInterface TYPO3\CMS\Extbase\Mvc\Web\Response TYPO3\CMS\Extbase\Tests\UnitDeprecated\Mvc\Web\Fixture\DummyWebResponse

Public Member Functions

 setContent ($content)
 
 appendContent ($content)
 
string getContent ()
 
string shutdown ()
 
string __toString ()
 
 setStatus ($code, $message=null)
 
string getStatus ()
 
int getStatusCode ()
 
 setHeader ($name, $value, $replaceExistingHeader=true)
 
string[] getHeaders ()
 
array getUnpreparedHeaders ()
 
 sendHeaders ()
 
 send ()
 
 addAdditionalHeaderData ($additionalHeaderData)
 
array getAdditionalHeaderData ()
 
 setRequest (Request $request)
 
TYPO3 CMS Extbase Mvc Request getRequest ()
 

Protected Member Functions

TypoScriptFrontendController getTypoScriptFrontendController ()
 

Protected Attributes

string $content
 
array $headers = array( )
 
array $additionalHeaderData = array( )
 
int $statusCode
 
string $statusMessage = 'OK'
 
TYPO3 CMS Extbase Mvc Request $request
 
array $statusMessages
 

Detailed Description

A generic and very basic response implementation

Definition at line 25 of file Response.php.

Member Function Documentation

◆ __toString()

string TYPO3\CMS\Extbase\Mvc\Response::__toString ( )

Returns the content of the response.

Returns
‪string

Definition at line 183 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\getContent().

◆ addAdditionalHeaderData()

TYPO3\CMS\Extbase\Mvc\Response::addAdditionalHeaderData (   $additionalHeaderData)

Adds an additional header data (something like '<script src="myext/Resources/JavaScript/my.js"></script>' )

@TODO The workaround and the $request member should be removed again, once the PageRender does support non-cached USER_INTs

Parameters
string$additionalHeaderData‪The value additional header
Exceptions

Definition at line 315 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$additionalHeaderData.

◆ appendContent()

TYPO3\CMS\Extbase\Mvc\Response::appendContent (   $content)

Appends content to the already existing content.

Parameters
string$content‪More response content

Implements TYPO3\CMS\Extbase\Mvc\ResponseInterface.

Definition at line 150 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$content.

◆ getAdditionalHeaderData()

array TYPO3\CMS\Extbase\Mvc\Response::getAdditionalHeaderData ( )

Returns the additional header data

Returns
‪array The additional header data

Definition at line 334 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$additionalHeaderData.

Referenced by TYPO3\CMS\Extbase\Mvc\Web\Response\shutdown().

◆ getContent()

string TYPO3\CMS\Extbase\Mvc\Response::getContent ( )

Returns the response content without sending it.

Returns
‪string The response content

Implements TYPO3\CMS\Extbase\Mvc\ResponseInterface.

Definition at line 160 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$content.

Referenced by TYPO3\CMS\Extbase\Mvc\Response\__toString(), TYPO3\CMS\Extbase\Mvc\Response\send(), and TYPO3\CMS\Extbase\Mvc\Response\shutdown().

◆ getHeaders()

string [] TYPO3\CMS\Extbase\Mvc\Response::getHeaders ( )

Returns the HTTP headers - including the status header - of this web response

Returns
‪string[] The HTTP headers

Definition at line 253 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$statusMessage.

Referenced by TYPO3\CMS\Extbase\Mvc\Response\sendHeaders().

◆ getRequest()

TYPO3 CMS Extbase Mvc Request TYPO3\CMS\Extbase\Mvc\Response::getRequest ( )
Returns
‪\TYPO3\CMS\Extbase\Mvc\Request

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 352 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$request.

◆ getStatus()

string TYPO3\CMS\Extbase\Mvc\Response::getStatus ( )

Returns status code and status message.

Returns
‪string The status code and status message, eg. "404 Not Found

Definition at line 212 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$statusMessage.

◆ getStatusCode()

int TYPO3\CMS\Extbase\Mvc\Response::getStatusCode ( )

Returns the status code, if not set, uses the OK status code 200

Returns
‪int

only use for backend module handling

Definition at line 223 of file Response.php.

◆ getTypoScriptFrontendController()

TypoScriptFrontendController TYPO3\CMS\Extbase\Mvc\Response::getTypoScriptFrontendController ( )
protected
Returns
‪TypoScriptFrontendController

Definition at line 360 of file Response.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Extbase\Mvc\Web\Response\shutdown().

◆ getUnpreparedHeaders()

array TYPO3\CMS\Extbase\Mvc\Response::getUnpreparedHeaders ( )

Returns the HTTP headers grouped by name without the status header

Returns
‪array all headers set for this request

only used within TYPO3 Core to convert to PSR-7 response headers

Definition at line 275 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$headers.

◆ send()

TYPO3\CMS\Extbase\Mvc\Response::send ( )

Renders and sends the whole web response

Definition at line 298 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\getContent(), and TYPO3\CMS\Extbase\Mvc\Response\sendHeaders().

◆ sendHeaders()

TYPO3\CMS\Extbase\Mvc\Response::sendHeaders ( )

Sends the HTTP headers.

If headers have already been sent, this method fails silently.

Definition at line 285 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\getHeaders().

Referenced by TYPO3\CMS\Extbase\Mvc\Response\send(), and TYPO3\CMS\Extbase\Mvc\Web\Response\shutdown().

◆ setContent()

TYPO3\CMS\Extbase\Mvc\Response::setContent (   $content)

Overrides and sets the content of the response

Parameters
string$content‪The response content

Implements TYPO3\CMS\Extbase\Mvc\ResponseInterface.

Definition at line 140 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$content.

Referenced by TYPO3\CMS\Extbase\Mvc\Response\shutdown().

◆ setHeader()

TYPO3\CMS\Extbase\Mvc\Response::setHeader (   $name,
  $value,
  $replaceExistingHeader = true 
)

Sets the specified HTTP header

Parameters
string$name‪Name of the header, for example "Location", "Content-Description" etc.
mixed$value‪The value of the given header
bool$replaceExistingHeader‪If a header with the same name should be replaced. Default is TRUE.
Exceptions

Definition at line 236 of file Response.php.

◆ setRequest()

TYPO3\CMS\Extbase\Mvc\Response::setRequest ( Request  $request)
Parameters
\TYPO3\CMS\Extbase\Mvc\Request$request

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 343 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$request.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\processRequest().

◆ setStatus()

TYPO3\CMS\Extbase\Mvc\Response::setStatus (   $code,
  $message = null 
)

Sets the HTTP status code and (optionally) a customized message.

Parameters
int$code‪The status code
string$message‪If specified, this message is sent instead of the standard message
Exceptions

Definition at line 195 of file Response.php.

◆ shutdown()

string TYPO3\CMS\Extbase\Mvc\Response::shutdown ( )

Fetches the content, returns and clears it.

Returns
‪string

only to be used within Extbase, not part of TYPO3 Core API.

Implements TYPO3\CMS\Extbase\Mvc\ResponseInterface.

Reimplemented in TYPO3\CMS\Extbase\Mvc\Web\Response.

Definition at line 171 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Response\$content, TYPO3\CMS\Extbase\Mvc\Response\getContent(), and TYPO3\CMS\Extbase\Mvc\Response\setContent().

Member Data Documentation

◆ $additionalHeaderData

array TYPO3\CMS\Extbase\Mvc\Response::$additionalHeaderData = array( )
protected

◆ $content

string TYPO3\CMS\Extbase\Mvc\Response::$content
protected

◆ $headers

array TYPO3\CMS\Extbase\Mvc\Response::$headers = array( )
protected

The HTTP headers which will be sent in the response

Definition at line 35 of file Response.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Response\getUnpreparedHeaders().

◆ $request

TYPO3 CMS Extbase Mvc Request TYPO3\CMS\Extbase\Mvc\Response::$request
protected

The Request which generated the Response

Definition at line 59 of file Response.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Response\getRequest(), and TYPO3\CMS\Extbase\Mvc\Response\setRequest().

◆ $statusCode

int TYPO3\CMS\Extbase\Mvc\Response::$statusCode
protected

The HTTP status code

Definition at line 47 of file Response.php.

◆ $statusMessage

string TYPO3\CMS\Extbase\Mvc\Response::$statusMessage = 'OK'
protected

The HTTP status message

Definition at line 53 of file Response.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Response\getHeaders(), and TYPO3\CMS\Extbase\Mvc\Response\getStatus().

◆ $statusMessages

array TYPO3\CMS\Extbase\Mvc\Response::$statusMessages
protected

The standardized and other important HTTP Status messages

Definition at line 65 of file Response.php.