class Formatter

Properties

protected $configurationCallbacks
protected $parsingCallbacks
protected $unparsingCallbacks
protected $renderingCallbacks
protected Repository $cache
protected string $cacheDir

Methods

__construct(Repository $cache, string $cacheDir)

No description

addConfigurationCallback($callback)

No description

addParsingCallback($callback)

No description

addUnparsingCallback($callback)

No description

addRenderingCallback($callback)

No description

string
parse(string $text, mixed $context = null, User $user = null)

Parse text.

string
render(string $xml, mixed|null $context = null, ServerRequestInterface $request = null)

Render parsed XML.

string
unparse(string $xml, mixed $context = null)

Unparse XML.

flush()

Flush the cache so that the formatter components are regenerated.

Configurator
getConfigurator()

No description

configureExternalLinks(Configurator $configurator)

No description

mixed
getComponent(string $name)

Get a TextFormatter component.

Parser
getParser(mixed $context = null)

Get the parser.

Renderer
getRenderer()

Get the renderer.

string
getJs()

Get the formatter JavaScript.

string
configureDefaultsOnLinks(Renderer $renderer, string $xml, $context = null, ServerRequestInterface $request = null)

No description

Details

__construct(Repository $cache, string $cacheDir)

Parameters

Repository $cache
string $cacheDir

addConfigurationCallback($callback)

Parameters

$callback

addParsingCallback($callback)

Parameters

$callback

addUnparsingCallback($callback)

Parameters

$callback

addRenderingCallback($callback)

Parameters

$callback

string parse(string $text, mixed $context = null, User $user = null)

Parse text.

Parameters

string $text
mixed $context
User $user

Return Value

string

string render(string $xml, mixed|null $context = null, ServerRequestInterface $request = null)

Render parsed XML.

Parameters

string $xml
mixed|null $context
ServerRequestInterface $request

Return Value

string

string unparse(string $xml, mixed $context = null)

Unparse XML.

Parameters

string $xml
mixed $context

Return Value

string

flush()

Flush the cache so that the formatter components are regenerated.

protected Configurator getConfigurator()

Return Value

Configurator

Parameters

Configurator $configurator

protected mixed getComponent(string $name)

Get a TextFormatter component.

Parameters

string $name "renderer" or "parser" or "js"

Return Value

mixed

protected Parser getParser(mixed $context = null)

Get the parser.

Parameters

mixed $context

Return Value

Parser

protected Renderer getRenderer()

Get the renderer.

Return Value

Renderer

string getJs()

Get the formatter JavaScript.

Return Value

string

Parameters

Renderer $renderer
string $xml
$context
ServerRequestInterface $request

Return Value

string