class ResponseRenderer (View source)

Singleton class used to manage the rendering of pages in PMA

Properties

static protected array<int,string> $httpStatusMessages

Methods

void
setAjax(bool $isAjax)

Set the ajax flag to indicate whether we are servicing an ajax request

getInstance()

Returns the singleton Response object

void
setRequestStatus(bool $state)

Set the status of an ajax response, whether it is a success or an error

bool
isAjax()

Returns true or false depending on whether we are servicing an ajax request

void
disable()

Disables the rendering of the header and the footer in responses

getHeader()

Returns a PhpMyAdmin\Header object

getFooter()

Returns a PhpMyAdmin\Footer object

void
addHTML(string $content)

Append HTML code to the current output buffer

void
addJSON(string|int|array $json, mixed|null $value = null)

Add JSON code to the response

void
response()

Sends an HTML response to the browser

void
header(string $text)

Wrapper around PHP's header() function.

bool
headersSent()

Wrapper around PHP's headers_sent() function.

void
httpResponseCode(int $response_code)

Wrapper around PHP's http_response_code() function.

void
setHttpResponseCode(int $responseCode)

Sets http response code.

void
generateHeader303(string $location)

Generate header for 303

bool
loginPage()

Configures response for the login page

Details

void setAjax(bool $isAjax)

Set the ajax flag to indicate whether we are servicing an ajax request

Parameters

bool $isAjax

Whether we are servicing an ajax request

Return Value

void

static ResponseRenderer getInstance()

Returns the singleton Response object

Return Value

ResponseRenderer

object

void setRequestStatus(bool $state)

Set the status of an ajax response, whether it is a success or an error

Parameters

bool $state

Whether the request was successfully processed

Return Value

void

bool isAjax()

Returns true or false depending on whether we are servicing an ajax request

Return Value

bool

void disable()

Disables the rendering of the header and the footer in responses

Return Value

void

Header getHeader()

Returns a PhpMyAdmin\Header object

Return Value

Header

Footer getFooter()

Returns a PhpMyAdmin\Footer object

Return Value

Footer

void addHTML(string $content)

Append HTML code to the current output buffer

Parameters

string $content

Return Value

void

void addJSON(string|int|array $json, mixed|null $value = null)

Add JSON code to the response

Parameters

string|int|array $json

Either a key (string) or an array or key-value pairs

mixed|null $value

Null, if passing an array in $json otherwise it's a string value to the key

Return Value

void

void response()

Sends an HTML response to the browser

Return Value

void

void header(string $text)

Wrapper around PHP's header() function.

Parameters

string $text

header string

Return Value

void

bool headersSent()

Wrapper around PHP's headers_sent() function.

Return Value

bool

void httpResponseCode(int $response_code)

Wrapper around PHP's http_response_code() function.

Parameters

int $response_code

will set the response code.

Return Value

void

void setHttpResponseCode(int $responseCode)

Sets http response code.

Parameters

int $responseCode

will set the response code.

Return Value

void

void generateHeader303(string $location)

Generate header for 303

Parameters

string $location

will set location to redirect.

Return Value

void

bool loginPage()

Configures response for the login page

Return Value

bool

Whether caller should exit