class Formatter implements ExtenderInterface, LifecycleInterface

Methods

configure(callable|string $callback)

Configure the formatter. This can be used to add support for custom markdown/bbcode/etc tags, or otherwise change the formatter. Please see documentation for the s9e text formatter library for more information on how to use this.

parse(callable|string $callback)

Prepare the system for parsing. This can be used to modify the text that will be parsed, or to modify the parser.

render(callable|string $callback)

Prepare the system for rendering. This can be used to modify the xml that will be rendered, or to modify the renderer.

extend(Container $container, Extension $extension = null)

No description

onEnable(Container $container, Extension $extension)

No description

onDisable(Container $container, Extension $extension)

No description

Details

configure(callable|string $callback)

Configure the formatter. This can be used to add support for custom markdown/bbcode/etc tags, or otherwise change the formatter. Please see documentation for the s9e text formatter library for more information on how to use this.

Parameters

callable|string $callback The callback can be a closure or invokable class, and should accept: - \s9e\TextFormatter\Configurator $configurator

parse(callable|string $callback)

Prepare the system for parsing. This can be used to modify the text that will be parsed, or to modify the parser.

Please note that the text to be parsed must be returned, regardless of whether it's changed.

Parameters

callable|string $callback The callback can be a closure or invokable class, and should accept: - \s9e\TextFormatter\Parser $parser - mixed $context - string $text: The text to be parsed.</p> <p>The callback should return: - string $text: The text to be parsed.

render(callable|string $callback)

Prepare the system for rendering. This can be used to modify the xml that will be rendered, or to modify the renderer.

Please note that the xml to be rendered must be returned, regardless of whether it's changed.

Parameters

callable|string $callback The callback can be a closure or invokable class, and should accept: - \s9e\TextFormatter\Rendered $renderer - mixed $context - string $xml: The xml to be rendered. - ServerRequestInterface $request. This argument MUST either be nullable, or omitted entirely.</p> <p>The callback should return: - string $xml: The xml to be rendered.

extend(Container $container, Extension $extension = null)

Parameters

Container $container
Extension $extension

onEnable(Container $container, Extension $extension)

Parameters

Container $container
Extension $extension

onDisable(Container $container, Extension $extension)

Parameters

Container $container
Extension $extension