abstract class Renderer

Properties

protected array $params
protected string $savedLocale

Methods

loadXML(string $xml)

Create a return a new DOMDocument loaded with given XML

string
render(string $xml)

Render an intermediate representation

string
renderPlainText(string $xml)

Render an intermediate representation of plain text

string
renderRichText(string $xml)

Render an intermediate representation of rich text

string
getParameter(string $paramName)

Get the value of a parameter

array
getParameters()

Get the values of all parameters

void
setParameter(string $paramName, mixed $paramValue)

Set the value of a parameter from the stylesheet

void
setParameters(array $params)

Set the values of several parameters from the stylesheet

void
checkUnsupported(string $xml)

Test for the presence of unsupported XML and throw an exception if found

string
decodeSMP(string $str)

Decode encoded characters from the Supplementary Multilingual Plane

static string
decodeEntity(array $m)

Decode a matched SGML entity

void
restoreLocale()

Restore the original locale

void
setLocale()

Temporarily set the locale to C

Details

at line 31
protected DOMDocument loadXML(string $xml)

Create a return a new DOMDocument loaded with given XML

Parameters

string $xml

Source XML

Return Value

DOMDocument

at line 58
string render(string $xml)

Render an intermediate representation

Parameters

string $xml

Intermediate representation

Return Value

string

Rendered result

at line 76
protected string renderPlainText(string $xml)

Render an intermediate representation of plain text

Parameters

string $xml

Intermediate representation

Return Value

string

Rendered result

at line 96
abstract protected string renderRichText(string $xml)

Render an intermediate representation of rich text

Parameters

string $xml

Intermediate representation

Return Value

string

Rendered result

at line 104
string getParameter(string $paramName)

Get the value of a parameter

Parameters

string $paramName

Return Value

string

at line 114
array getParameters()

Get the values of all parameters

Return Value

array

Associative array of parameter names and values

at line 126
void setParameter(string $paramName, mixed $paramValue)

Set the value of a parameter from the stylesheet

Parameters

string $paramName

Parameter name

mixed $paramValue

Parameter's value

Return Value

void

at line 137
void setParameters(array $params)

Set the values of several parameters from the stylesheet

Parameters

array $params

Associative array of [parameter name => parameter value]

Return Value

void

at line 151
protected void checkUnsupported(string $xml)

Test for the presence of unsupported XML and throw an exception if found

Parameters

string $xml XML

Return Value

void

at line 170
protected string decodeSMP(string $str)

Decode encoded characters from the Supplementary Multilingual Plane

Parameters

string $str

Encoded string

Return Value

string

Decoded string

at line 186
static protected string decodeEntity(array $m)

Decode a matched SGML entity

Parameters

array $m

Captures from PCRE

Return Value

string

Decoded entity

at line 194
protected void restoreLocale()

Restore the original locale

Return Value

void

at line 205
protected void setLocale()

Temporarily set the locale to C

Return Value

void