class HTTPOutputHandler extends AbstractProcessingHandler

Output the error to the browser, with the given HTTP status code.

We recommend that you use a formatter that generates HTML with this.

Methods

string
getContentType()

Get the mime type to use when displaying this error.

setContentType(string $contentType)

Set the mime type to use when displaying this error.

int
getStatusCode()

Get the HTTP status code to use when displaying this error.

$this
setStatusCode(int $statusCode)

Set the HTTP status code to use when displaying this error.

setCLIFormatter(FormatterInterface $cliFormatter)

Set a formatter to use if Director::is_cli() is true

FormatterInterface
getCLIFormatter()

Return the formatter use if Director::is_cli() is true If none has been set, null is returned, and the getFormatter() result will be used instead

FormatterInterface
getFormatter()

Return the formatter to use in this case.

FormatterInterface
getDefaultFormatter()

Check default formatter to use

$this
setDefaultFormatter(FormatterInterface $formatter)

Set default formatter

Details

at line 38
string getContentType()

Get the mime type to use when displaying this error.

Return Value

string

at line 50
HTTPOutputHandler setContentType(string $contentType)

Set the mime type to use when displaying this error.

Default text/html

Parameters

string $contentType

Return Value

HTTPOutputHandler Return $this to allow chainable calls

at line 61
int getStatusCode()

Get the HTTP status code to use when displaying this error.

Return Value

int

at line 73
$this setStatusCode(int $statusCode)

Set the HTTP status code to use when displaying this error.

Default 500

Parameters

int $statusCode

Return Value

$this

at line 85
HTTPOutputHandler setCLIFormatter(FormatterInterface $cliFormatter)

Set a formatter to use if Director::is_cli() is true

Parameters

FormatterInterface $cliFormatter

Return Value

HTTPOutputHandler Return $this to allow chainable calls

at line 98
FormatterInterface getCLIFormatter()

Return the formatter use if Director::is_cli() is true If none has been set, null is returned, and the getFormatter() result will be used instead

Return Value

FormatterInterface

at line 109
FormatterInterface getFormatter()

Return the formatter to use in this case.

May be the getCliFormatter() value if one is provided and Director::is_cli() is true.

Return Value

FormatterInterface

at line 123
FormatterInterface getDefaultFormatter()

Check default formatter to use

Return Value

FormatterInterface

at line 134
$this setDefaultFormatter(FormatterInterface $formatter)

Set default formatter

Parameters

FormatterInterface $formatter

Return Value

$this