MediaWiki master
MediaWiki\Rest\Handler\Helper\HtmlOutputHelper Interface Reference

Inherited by MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.

Public Member Functions

 getETag (string $suffix='')
 Returns an ETag uniquely identifying the HTML output.
 
 getHtml ()
 Fetch the HTML for rendering of a given page.
 
 getLastModified ()
 Returns the time at which the HTML was rendered.
 
 getParamSettings ()
 Gets the request parameters of this request.
 
 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.
 

Detailed Description

Since
1.40
Stability: unstable

Definition at line 32 of file HtmlOutputHelper.php.

Member Function Documentation

◆ getETag()

MediaWiki\Rest\Handler\Helper\HtmlOutputHelper::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.

Implemented in MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.

◆ getHtml()

MediaWiki\Rest\Handler\Helper\HtmlOutputHelper::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

Implemented in MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.

◆ getLastModified()

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

Returns the time at which the HTML was rendered.

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

Implemented in MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.

◆ getParamSettings()

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

Gets the request parameters of this request.

See also
Handler::getParamSettings()
Returns
array

Implemented in MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.

◆ putHeaders()

MediaWiki\Rest\Handler\Helper\HtmlOutputHelper::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

Implemented in MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.

◆ setVariantConversionLanguage()

MediaWiki\Rest\Handler\Helper\HtmlOutputHelper::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

Implemented in MediaWiki\Rest\Handler\Helper\HtmlMessageOutputHelper, and MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper.


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