TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Web\Response Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Web\Response:
TYPO3\CMS\Extbase\Mvc\Response TYPO3\CMS\Extbase\Mvc\ResponseInterface Tx_Extbase_MVC_Web_Response

Public Member Functions

 setStatus ($code, $message=NULL)
 
 getStatus ()
 
 setHeader ($name, $value, $replaceExistingHeader=TRUE)
 
 getHeaders ()
 
 sendHeaders ()
 
 send ()
 
 addAdditionalHeaderData ($additionalHeaderData)
 
 getAdditionalHeaderData ()
 
 setRequest (\TYPO3\CMS\Extbase\Mvc\Web\Request $request)
 
 getRequest ()
 
 shutdown ()
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Mvc\Response
 setContent ($content)
 
 appendContent ($content)
 
 getContent ()
 
 shutdown ()
 
 __toString ()
 

Protected Attributes

 $headers = array()
 
 $additionalHeaderData = array()
 
 $statusCode
 
 $statusMessage = 'OK'
 
 $request
 
 $statusMessages
 
 $environmentService
 
- Protected Attributes inherited from TYPO3\CMS\Extbase\Mvc\Response
 $content = NULL
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! A web specific response implementation

Definition at line 21 of file Response.php.

Member Function Documentation

◆ addAdditionalHeaderData()

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

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

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

Parameters
string$additionalHeaderDataThe value additonal header
Exceptions

Definition at line 230 of file Response.php.

References TYPO3\CMS\Extbase\Mvc\Web\Response\$additionalHeaderData, and $GLOBALS.

◆ getAdditionalHeaderData()

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

Returns the additional header data

Returns
array The additional header data

Definition at line 252 of file Response.php.

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

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

◆ getHeaders()

TYPO3\CMS\Extbase\Mvc\Web\Response::getHeaders ( )

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

Returns
string The HTTP headers

Definition at line 174 of file Response.php.

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

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

◆ getRequest()

TYPO3\CMS\Extbase\Mvc\Web\Response::getRequest ( )
Returns

Definition at line 266 of file Response.php.

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

◆ getStatus()

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

Returns status code and status message.

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

Definition at line 143 of file Response.php.

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

◆ send()

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

Renders and sends the whole web response

Returns
void

Definition at line 212 of file Response.php.

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

◆ sendHeaders()

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

Sends the HTTP headers.

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

Returns
void

Definition at line 197 of file Response.php.

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

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

◆ setHeader()

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

Sets the specified HTTP header

Parameters
string$nameName of the header, for example "Location", "Content-Description" etc.
mixed$valueThe value of the given header
boolean$replaceExistingHeaderIf a header with the same name should be replaced. Default is TRUE.
Exceptions

Definition at line 157 of file Response.php.

◆ setRequest()

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

Definition at line 259 of file Response.php.

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

◆ setStatus()

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

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

Parameters
integer$codeThe status code
string$messageIf specified, this message is sent instead of the standard message
Exceptions

Definition at line 126 of file Response.php.

◆ shutdown()

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

Sends additional headers and returns the content

Returns
null|string

Implements TYPO3\CMS\Extbase\Mvc\ResponseInterface.

Definition at line 275 of file Response.php.

References $GLOBALS, TYPO3\CMS\Extbase\Mvc\Web\Response\getAdditionalHeaderData(), and TYPO3\CMS\Extbase\Mvc\Web\Response\sendHeaders().

Member Data Documentation

◆ $additionalHeaderData

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

◆ $environmentService

TYPO3\CMS\Extbase\Mvc\Web\Response::$environmentService
protected

Definition at line 115 of file Response.php.

◆ $headers

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

Definition at line 28 of file Response.php.

◆ $request

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

◆ $statusCode

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

Definition at line 42 of file Response.php.

◆ $statusMessage

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

◆ $statusMessages

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

Definition at line 63 of file Response.php.