PHP Class Flarum\Formatter\Formatter

Mostrar archivo Open project: flarum/core Class Usage Examples

Protected Properties

Property Type Description
$cache Illuminate\Contracts\Cache\Repository
$cacheDir string
$events Illuminate\Contracts\Events\Dispatcher

Public Methods

Method Description
__construct ( Illuminate\Contracts\Cache\Repository $cache, Illuminate\Contracts\Events\Dispatcher $events, string $cacheDir )
flush ( ) Flush the cache so that the formatter components are regenerated.
getJs ( ) : string Get the formatter JavaScript.
parse ( string $text, mixed $context = null ) : string Parse text.
render ( string $xml, mixed $context = null ) : string Render parsed XML.
unparse ( string $xml ) : string Unparse XML.

Protected Methods

Method Description
configureExternalLinks ( s9e\TextFormatter\Configurator $configurator )
getComponent ( string $name ) : mixed Get a TextFormatter component.
getConfigurator ( ) : s9e\TextFormatter\Configurator
getParser ( mixed $context = null ) : s9e\TextFormatter\Parser Get the parser.
getRenderer ( mixed $context = null ) : s9e\TextFormatter\Renderer Get the renderer.

Method Details

__construct() public method

public __construct ( Illuminate\Contracts\Cache\Repository $cache, Illuminate\Contracts\Events\Dispatcher $events, string $cacheDir )
$cache Illuminate\Contracts\Cache\Repository
$events Illuminate\Contracts\Events\Dispatcher
$cacheDir string

flush() public method

Flush the cache so that the formatter components are regenerated.
public flush ( )

getComponent() protected method

Get a TextFormatter component.
protected getComponent ( string $name ) : mixed
$name string "renderer" or "parser"
return mixed

getConfigurator() protected method

protected getConfigurator ( ) : s9e\TextFormatter\Configurator
return s9e\TextFormatter\Configurator

getJs() public method

Get the formatter JavaScript.
public getJs ( ) : string
return string

getParser() protected method

Get the parser.
protected getParser ( mixed $context = null ) : s9e\TextFormatter\Parser
$context mixed
return s9e\TextFormatter\Parser

getRenderer() protected method

Get the renderer.
protected getRenderer ( mixed $context = null ) : s9e\TextFormatter\Renderer
$context mixed
return s9e\TextFormatter\Renderer

parse() public method

Parse text.
public parse ( string $text, mixed $context = null ) : string
$text string
$context mixed
return string

render() public method

Render parsed XML.
public render ( string $xml, mixed $context = null ) : string
$xml string
$context mixed
return string

unparse() public method

Unparse XML.
public unparse ( string $xml ) : string
$xml string
return string

Property Details

$cache protected_oe property

protected Repository,Illuminate\Contracts\Cache $cache
return Illuminate\Contracts\Cache\Repository

$cacheDir protected_oe property

protected string $cacheDir
return string

$events protected_oe property

protected Dispatcher,Illuminate\Contracts\Events $events
return Illuminate\Contracts\Events\Dispatcher