class ResponseRenderer (View source)

Singleton class used to manage the rendering of pages in PMA

Properties

protected $header

Header instance

$footer

PhpMyAdmin\Footer instance

protected $isAjax

Whether we are servicing an ajax request.

protected $isDisabled

Whether response object is disabled

protected $isSuccess

Whether there were any errors during the processing of the request Only used for ajax responses

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 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

void
addHTML(string $content)

Append HTML code to the current output buffer

void
addJSON(string|int|array $json, mixed $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 $responseCode)

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

void
setMinimalFooter()

No description

string
getSelfUrl()

No description

getFooterScripts()

No description

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 object

Return Value

ResponseRenderer

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

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 $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 $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 $responseCode)

Wrapper around PHP's http_response_code() function.

Parameters

int $responseCode

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

void setMinimalFooter()

No description

Return Value

void

string getSelfUrl()

No description

Return Value

string

Scripts getFooterScripts()

No description

Return Value

Scripts