factory
class factory implements cache_interface
Creates s9e\TextFormatter objects
Properties
protected link_helper | $link_helper | ||
protected driver_interface | $cache | ||
protected string | $cache_dir | ||
protected string | $cache_key_parser | ||
protected string | $cache_key_renderer | ||
protected config | $config | ||
protected array | $custom_tokens | ||
protected data_access | $data_access | ||
protected array | $default_definitions | ||
protected array | $default_templates | ||
protected dispatcher_interface | $dispatcher | ||
protected log_interface | $log |
Methods
Constructor
Invalidate and/or regenerate this text formatter's cache(s)
Tidy/prune this text formatter's cache(s)
Generate and return a new configured instance of s9e\TextFormatter\Configurator
Regenerate and cache a new parser and renderer
Add a BBCode to given configurator
Configure the Autolink / Autoemail plugins used to linkify text
Escape a literal to be used in an HTML attribute in an XSL template
Return the default BBCodes configuration
Extract and recompose individual BBCode templates from a style's template file
Merge the templates from any number of styles into one BBCode template
Details
at line 171
__construct(data_access $data_access, driver_interface $cache, dispatcher_interface $dispatcher, config $config, link_helper $link_helper, log_interface $log, string $cache_dir, string $cache_key_parser, string $cache_key_renderer)
Constructor
at line 187
invalidate()
Invalidate and/or regenerate this text formatter's cache(s)
at line 197
tidy()
Tidy/prune this text formatter's cache(s)
at line 218
Configurator
get_configurator()
Generate and return a new configured instance of s9e\TextFormatter\Configurator
at line 382
array
regenerate()
Regenerate and cache a new parser and renderer
at line 431
protected void
add_bbcode(Configurator $configurator, string $usage, string $template)
Add a BBCode to given configurator
at line 449
protected void
configure_autolink(Configurator $configurator)
Configure the Autolink / Autoemail plugins used to linkify text
at line 499
protected string
escape_html_attribute(string $value)
Escape a literal to be used in an HTML attribute in an XSL template
Escapes "HTML special chars" for obvious reasons and curly braces to avoid them being interpreted as an attribute value template
at line 509
protected array
get_default_bbcodes($configurator)
Return the default BBCodes configuration
at line 564
protected array
extract_templates(string $template)
Extract and recompose individual BBCode templates from a style's template file
at line 645
protected string
merge_templates(array $style_templates)
Merge the templates from any number of styles into one BBCode template
When multiple templates are available for the same BBCode (because of multiple styles) we merge them into a single template that uses an xsl:choose construct that determines which style to use at rendering time.