PHP Class PMA\libraries\Response

Afficher le fichier Open project: phpmyadmin/phpmyadmin Class Usage Examples

Méthodes publiques

Méthode Description
addHTML ( string $content ) : void Add HTML code to the response
addJSON ( mixed $json, mixed $value = null ) : void Add JSON code to the response
disable ( ) : void Disables the rendering of the header and the footer in responses
getCWD ( ) : string Returns the path to the current working directory Necessary to work around a PHP bug where the CWD is reset after the initial script exits
getFooter ( ) : Footer Returns a PMA\libraries\Footer object
getHeader ( ) : Header Returns a PMA\libraries\Header object
getInstance ( ) : Response Returns the singleton Response object
header ( string $text ) : void Wrapper around PHP's header() function.
headersSent ( ) : boolean Wrapper around PHP's headers_sent() function.
isAjax ( ) : boolean Returns true or false depending on whether we are servicing an ajax request
response ( ) : void Sends an HTML response to the browser
setRequestStatus ( boolean $state ) : void Set the status of an ajax response, whether it is a success or an error

Private Methods

Méthode Description
__construct ( ) Creates a new class instance
_ajaxResponse ( ) : void Sends a JSON response to the browser
_getDisplay ( ) : string Renders the HTML response text
_htmlResponse ( ) : void Sends an HTML response to the browser

Method Details

addHTML() public méthode

Add HTML code to the response
public addHTML ( string $content ) : void
$content string A string to be appended to the current output buffer
Résultat void

addJSON() public méthode

Add JSON code to the response
public addJSON ( mixed $json, mixed $value = null ) : void
$json mixed Either a key (string) or an array or key-value pairs
$value mixed Null, if passing an array in $json otherwise it's a string value to the key
Résultat void

disable() public méthode

Disables the rendering of the header and the footer in responses
public disable ( ) : void
Résultat void

getCWD() public méthode

Returns the path to the current working directory Necessary to work around a PHP bug where the CWD is reset after the initial script exits
public getCWD ( ) : string
Résultat string

getFooter() public méthode

Returns a PMA\libraries\Footer object
public getFooter ( ) : Footer
Résultat Footer

getHeader() public méthode

Returns a PMA\libraries\Header object
public getHeader ( ) : Header
Résultat Header

getInstance() public static méthode

Returns the singleton Response object
public static getInstance ( ) : Response
Résultat Response object

header() public méthode

Wrapper around PHP's header() function.
public header ( string $text ) : void
$text string header string
Résultat void

headersSent() public méthode

Wrapper around PHP's headers_sent() function.
public headersSent ( ) : boolean
Résultat boolean

isAjax() public méthode

Returns true or false depending on whether we are servicing an ajax request
public isAjax ( ) : boolean
Résultat boolean

response() public static méthode

Sends an HTML response to the browser
public static response ( ) : void
Résultat void

setRequestStatus() public méthode

Set the status of an ajax response, whether it is a success or an error
public setRequestStatus ( boolean $state ) : void
$state boolean Whether the request was successfully processed
Résultat void