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)

<p>Parse text.</p>

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

<p>Render parsed XML.</p>

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

<p>Unparse XML.</p>

flush()

<p>Flush the cache so that the formatter components are regenerated.</p>

Configurator
getConfigurator()

No description

configureExternalLinks(Configurator $configurator)

No description

mixed
getComponent(string $name)

<p>Get a TextFormatter component.</p>

Parser
getParser(mixed $context = null)

<p>Get the parser.</p>

Renderer
getRenderer()

<p>Get the renderer.</p>

string
getJs()

<p>Get the formatter JavaScript.</p>

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)

<p>Parse text.</p>

Parameters

string $text
mixed $context
User $user

Return Value

string <p>the parsed XML</p>

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

<p>Render parsed XML.</p>

Parameters

string $xml
mixed|null $context
ServerRequestInterface $request

Return Value

string

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

<p>Unparse XML.</p>

Parameters

string $xml
mixed $context

Return Value

string

flush()

<p>Flush the cache so that the formatter components are regenerated.</p>

protected Configurator getConfigurator()

Return Value

Configurator

Parameters

Configurator $configurator

protected mixed getComponent(string $name)

<p>Get a TextFormatter component.</p>

Parameters

string $name <p>&quot;renderer&quot; or &quot;parser&quot; or &quot;js&quot;</p>

Return Value

mixed

protected Parser getParser(mixed $context = null)

<p>Get the parser.</p>

Parameters

mixed $context

Return Value

Parser

protected Renderer getRenderer()

<p>Get the renderer.</p>

Return Value

Renderer

string getJs()

<p>Get the formatter JavaScript.</p>

Return Value

string

Parameters

Renderer $renderer
string $xml
$context
ServerRequestInterface $request

Return Value

string