MediaWiki master
MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper Class Reference

Inherits MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Collaboration diagram for MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper:

Public Member Functions

 getETag (string $suffix='')
 Returns an ETag uniquely identifying the HTML output.
See also
Handler::getETag()
Parameters
string$suffixA suffix to attach to the etag. Must consist of characters that are legal in ETags.
Returns
string|null We return null when there is no etag.

 
 getHtml ()
 Fetch the HTML for rendering of a given page.If the rendering is available in parsoid parser cache, return that. Otherwise, perform a parse and return the result while caching it in the parser cache.NOTE: Caching can be explicitly disabled or a force parse action can be issued. Stashing and rate limiting on stashing also applies here if specified.
Returns
ParserOutput a tuple with html and content-type
Exceptions
LocalizedHttpException
ClientError

 
 getLastModified ()
 Returns the time at which the HTML was rendered.
See also
Handler::getLastModified()
Returns
string|null

 
 getParamSettings ()
 Gets the request parameters of this request.
See also
Handler::getParamSettings()
Returns
array

 
 init (PageIdentity $page)
 Initializes the helper with the given parameters like the page we're dealing with.
 
 putHeaders (ResponseInterface $response, bool $forHtml=true)
 Set the HTTP headers based on the response generated.
 
 setVariantConversionLanguage ( $targetLanguage, $sourceLanguage=null)
 Set the language to be used for variant conversion.If $targetLanguage is a string, it may be a list of language ranges as specified by RFC 9110 for use in the Accept-Language header. Implementations must be able to process this format, and may use the information provided to choose a supported target language that is desirable to the client.
Parameters
Bcp47Code | string$targetLanguage
Bcp47Code | string | null$sourceLanguage

 

Detailed Description

Since
1.40
Stability: unstable

Definition at line 35 of file HtmlMessageOutputHelper.php.

Member Function Documentation

◆ getETag()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getETag ( string $suffix = '')

Returns an ETag uniquely identifying the HTML output.

See also
Handler::getETag()
Parameters
string$suffixA suffix to attach to the etag. Must consist of characters that are legal in ETags.
Returns
string|null We return null when there is no etag.

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 80 of file HtmlMessageOutputHelper.php.

◆ getHtml()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getHtml ( )

Fetch the HTML for rendering of a given page.If the rendering is available in parsoid parser cache, return that. Otherwise, perform a parse and return the result while caching it in the parser cache.NOTE: Caching can be explicitly disabled or a force parse action can be issued. Stashing and rate limiting on stashing also applies here if specified.

Returns
ParserOutput a tuple with html and content-type
Exceptions
LocalizedHttpException
ClientError

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 61 of file HtmlMessageOutputHelper.php.

◆ getLastModified()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getLastModified ( )

Returns the time at which the HTML was rendered.

See also
Handler::getLastModified()
Returns
string|null

Note
This is guaranteed to always return NULL since proper system messages (with no DB entry) have no revision, so they should have no last modified time.

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 95 of file HtmlMessageOutputHelper.php.

◆ getParamSettings()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::getParamSettings ( )

Gets the request parameters of this request.

See also
Handler::getParamSettings()
Returns
array

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 102 of file HtmlMessageOutputHelper.php.

◆ init()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::init ( PageIdentity $page)

Initializes the helper with the given parameters like the page we're dealing with.

Parameters
PageIdentity$page

Definition at line 45 of file HtmlMessageOutputHelper.php.

◆ putHeaders()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::putHeaders ( ResponseInterface $response,
bool $forHtml = true )

Set the HTTP headers based on the response generated.

Parameters
ResponseInterface$response
bool$forHtmlWhether the response will be HTML (rather than JSON)
Returns
void

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 116 of file HtmlMessageOutputHelper.php.

◆ setVariantConversionLanguage()

MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper::setVariantConversionLanguage ( $targetLanguage,
$sourceLanguage = null )

Set the language to be used for variant conversion.If $targetLanguage is a string, it may be a list of language ranges as specified by RFC 9110 for use in the Accept-Language header. Implementations must be able to process this format, and may use the information provided to choose a supported target language that is desirable to the client.

Parameters
Bcp47Code | string$targetLanguage
Bcp47Code | string | null$sourceLanguage

Implements MediaWiki\Rest\Handler\Helper\HtmlOutputHelper.

Definition at line 109 of file HtmlMessageOutputHelper.php.


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