MediaWiki  master
AjaxResponse Class Reference

Handle responses for Ajax requests (send headers, print content, that sort of thing) More...

Collaboration diagram for AjaxResponse:

Public Member Functions

 __construct ( $text=null, Config $config=null)
 addText ( $text)
 Add content to the response. More...
 disable ()
 Disable output. More...
 printText ()
 Output text. More...
 sendHeaders ()
 Construct the header and output it. More...
 setContentType ( $type)
 Set the HTTP header Content-Type. More...
 setResponseCode ( $code)
 Set the HTTP response code. More...

Private Attributes

int $mCacheDuration
 Number of seconds to get the response cached by a proxy. More...
Config $mConfig
string $mContentType
 HTTP header Content-Type. More...
bool $mDisabled
 Disables output. More...
string bool $mLastModified
 Date for the HTTP header Last-modified. More...
int string $mResponseCode
 HTTP response code. More...
string $mText
 Content of our HTTP response. More...
string $mVary
 HTTP Vary header. More...

Detailed Description

Handle responses for Ajax requests (send headers, print content, that sort of thing)

Definition at line 31 of file AjaxResponse.php.

Constructor & Destructor Documentation

◆ __construct()

AjaxResponse::__construct (   $text = null,
Config  $config = null 
string | null$text
Config | null$config

Definition at line 83 of file AjaxResponse.php.

References addText().

Member Function Documentation

◆ addText()

AjaxResponse::addText (   $text)

Add content to the response.


Definition at line 126 of file AjaxResponse.php.

Referenced by __construct().

◆ disable()

AjaxResponse::disable ( )

Disable output.

Definition at line 118 of file AjaxResponse.php.

◆ printText()

AjaxResponse::printText ( )

Output text.

Definition at line 135 of file AjaxResponse.php.

References $mText.

◆ sendHeaders()

AjaxResponse::sendHeaders ( )

Construct the header and output it.

Definition at line 144 of file AjaxResponse.php.

References HttpStatus\header().

◆ setContentType()

AjaxResponse::setContentType (   $type)

Set the HTTP header Content-Type.


Definition at line 111 of file AjaxResponse.php.

References $type.

◆ setResponseCode()

AjaxResponse::setResponseCode (   $code)

Set the HTTP response code.

int | string$code

Definition at line 103 of file AjaxResponse.php.

Member Data Documentation

◆ $mCacheDuration

int AjaxResponse::$mCacheDuration

Number of seconds to get the response cached by a proxy.

Definition at line 36 of file AjaxResponse.php.

◆ $mConfig

Config AjaxResponse::$mConfig

Definition at line 77 of file AjaxResponse.php.

◆ $mContentType

string AjaxResponse::$mContentType

HTTP header Content-Type.

Definition at line 42 of file AjaxResponse.php.

◆ $mDisabled

bool AjaxResponse::$mDisabled

Disables output.

Can be set by calling $AjaxResponse->disable()

Definition at line 48 of file AjaxResponse.php.

◆ $mLastModified

string bool AjaxResponse::$mLastModified

Date for the HTTP header Last-modified.

Definition at line 54 of file AjaxResponse.php.

◆ $mResponseCode

int string AjaxResponse::$mResponseCode

HTTP response code.

Definition at line 60 of file AjaxResponse.php.

◆ $mText

string AjaxResponse::$mText

Content of our HTTP response.

Definition at line 72 of file AjaxResponse.php.

Referenced by printText().

◆ $mVary

string AjaxResponse::$mVary

HTTP Vary header.

Definition at line 66 of file AjaxResponse.php.

The documentation for this class was generated from the following file: