MediaWiki
REL1_39
ContentRenderer.php
Go to the documentation of this file.
1
<?php
2
namespace
MediaWiki\Content\Renderer
;
3
4
use
Content
;
5
use
MediaWiki\Content\IContentHandlerFactory
;
6
use
MediaWiki\Page\PageReference
;
7
use
ParserOptions
;
8
use
ParserOutput
;
9
15
class
ContentRenderer
{
17
private
$contentHandlerFactory;
18
22
public
function
__construct
(
IContentHandlerFactory
$contentHandlerFactory ) {
23
$this->contentHandlerFactory = $contentHandlerFactory;
24
}
25
37
public
function
getParserOutput
(
38
Content
$content
,
39
PageReference
$page,
40
?
int
$revId =
null
,
41
?
ParserOptions
$parserOptions =
null
,
42
bool
$generateHtml =
true
43
):
ParserOutput
{
44
$contentHandler = $this->contentHandlerFactory->getContentHandler(
$content
->getModel() );
45
$cpoParams =
new
ContentParseParams
( $page, $revId, $parserOptions, $generateHtml );
46
47
return
$contentHandler->getParserOutput(
$content
, $cpoParams );
48
}
49
}
MediaWiki\Content\Renderer\ContentParseParams
Definition
ContentParseParams.php:11
MediaWiki\Content\Renderer\ContentRenderer
A service to render content.
Definition
ContentRenderer.php:15
MediaWiki\Content\Renderer\ContentRenderer\__construct
__construct(IContentHandlerFactory $contentHandlerFactory)
Definition
ContentRenderer.php:22
MediaWiki\Content\Renderer\ContentRenderer\getParserOutput
getParserOutput(Content $content, PageReference $page, ?int $revId=null, ?ParserOptions $parserOptions=null, bool $generateHtml=true)
Returns a ParserOutput object containing information derived from this content.
Definition
ContentRenderer.php:37
ParserOptions
Set options of the Parser.
Definition
ParserOptions.php:46
ParserOutput
Definition
ParserOutput.php:38
Content
Base interface for content objects.
Definition
Content.php:35
MediaWiki\Content\IContentHandlerFactory
Definition
IContentHandlerFactory.php:10
MediaWiki\Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
Definition
PageReference.php:49
MediaWiki\Content\Renderer
Definition
ContentParseParams.php:2
$content
$content
Definition
router.php:76
includes
content
Renderer
ContentRenderer.php
Generated on Mon Nov 4 2024 07:22:40 for MediaWiki by
1.10.0