SilverStripe 2.4 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
Version: master
  • master
  • 3.1
  • 3.0
  • 2.4
  • tagfield

Packages

  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • publishers
    • reports
    • security
    • tasks
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • installer
  • None
  • PHP
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets

Classes

  • ContentController
  • ContentNegotiator
  • Controller
  • Director
  • ModelAsController
  • RemoveOrphanedPagesTask
  • RequestHandler
  • RootURLController
  • SapphireInfo
  • Session
  • SS_HTTPRequest
  • SS_HTTPResponse

Interfaces

  • NestedController

Exceptions

  • SS_HTTPResponse_Exception

Class SS_HTTPResponse

Represents a response returned by a controller.

Direct known subclasses

RestfulService_Response

Package: sapphire\control
Located at sapphire/core/control/HTTPResponse.php

Methods summary

public
# __construct( mixed $body = null, mixed $statusCode = null, mixed $statusDescription = null )

Create a new HTTP response

Create a new HTTP response

Parameters

$body
mixed
$body The body of the response
$statusCode
mixed
$statusCode The numeric status code - 200, 404, etc
$statusDescription
mixed
$statusDescription The text to be given alongside the status code. See SS_HTTPResponse::setStatusCode() for more information.
public
# setStatusCode( String $code, String $description = null )

Parameters

$code
String
$code
$description
String
$description Optional. See SS_HTTPResponse::setStatusDescription(). No newlines are allowed in the description. If omitted, will default to the standard HTTP description for the given $code value (see SS_HTTPResponse::$status_codes).
public
# setStatusDescription( String $description )

The text to be given alongside the status code ("reason phrase"). Caution: Will be overwritten by SS_HTTPResponse::setStatusCode().

The text to be given alongside the status code ("reason phrase"). Caution: Will be overwritten by SS_HTTPResponse::setStatusCode().

Parameters

$description
String
$description
public Int
# getStatusCode( )

Returns

Int
public string
# getStatusDescription( )

Returns

string
Description for a HTTP status code
public
# isError( )

Returns true if this HTTP response is in error

Returns true if this HTTP response is in error

public
# setBody( mixed $body )
public
# getBody( )
public
# addHeader( string $header, string $value )

Add a HTTP header to the response, replacing any header of the same name.

Add a HTTP header to the response, replacing any header of the same name.

Parameters

$header
string
$header Example: "Content-Type"
$value
string
$value Example: "text/xml"
public
# getHeader( string $header )

Return the HTTP header of the given name.

Return the HTTP header of the given name.

Parameters

$header
string
$header

Returns

string
public array
# getHeaders( )

Returns

array
public
# removeHeader( unknown_type $header )

Remove an existing HTTP header by its name, e.g. "Content-Type".

Remove an existing HTTP header by its name, e.g. "Content-Type".

Parameters

$header
unknown_type
$header
public
# redirect( mixed $dest, mixed $code = 302 )
public
# output( )

Send this HTTPReponse to the browser

Send this HTTPReponse to the browser

public
# isFinished( )

Returns true if this response is "finished", that is, no more script execution should be done. Specifically, returns true if a redirect has already been requested

Returns true if this response is "finished", that is, no more script execution should be done. Specifically, returns true if a redirect has already been requested

public
# getLinks( )

Deprecated

2.4 Use HTTP::getLinksIn() on DOMDocument.

Magic methods summary

Properties summary

protected static array $status_codes
#
protected static array $redirect_codes
#
protected Int $statusCode
#
protected String $statusDescription
#
protected array $headers
#

HTTP Headers like "Content-Type: text/xml"

HTTP Headers like "Content-Type: text/xml"

See

http://en.wikipedia.org/wiki/List_of_HTTP_headers
protected string $body
#

Comments

Comment policy: Please use comments for tips and corrections about the described functionality. Comments are moderated, we reserve the right to remove comments that are inappropriate or are no longer relevant.
Use the Silverstripe Forum to ask questions.
blog comments powered by Disqus
SilverStripe 2.4 API Docs API documentation generated by ApiGen 2.8.0