The TextFormatter class eases text formatting.
The TextFormatter class eases text formatting.
It provides 4 formatter methods to format the input text: textile, entities, specialchars and raw. The 'textile' formatter formats the text using the rich Textile formatting language. The 'entities' and 'specialchars' formatters escape HTML entities so that the result can safely be displayed in a web browser. The 'raw' formatter returns the unchanged input text (this is useful if the formatter type comes from a database column). Additionally, there's the 'auto' formatter that chooses between textile and raw, depending on the input looking like XHTML (using a very simple heuristic).
format($text, $formatter=null) [static] ¶Formats text using the given formatter.
This method is useful if you don't want to instantiate a TextFormatter object. If you want to reuse the textformatter instance, don't use this method.
$textString with text to format
$formatterThe name of the formatter to use (optional)
String containing the formatted text
TextFormatter($text=null, $formatter=null) ¶Initialize a new text formatter instance.
Both the text and formatter parameters are optional and can be set later using the 'text' and 'formatter' container properties.
$textString with text to format (optional).
$formatterThe name of the formatter to use (optional).
$default_formatter ¶The default formatter.
$formatters [private] ¶List of all available formatters.
AnewtContainer::_to_array()AnewtContainer::_add()AnewtContainer::delete()AnewtContainer::get()AnewtContainer::_isset()AnewtContainer::_seed()AnewtContainer::setdefault()AnewtContainer::getdefault()AnewtContainer::set()AnewtContainer::__isset()AnewtContainer::__set()AnewtContainer::__construct()AnewtContainer::is_set()AnewtContainer::add()AnewtContainer::_getdefault()AnewtContainer::__unset()AnewtContainer::seed()AnewtContainer::to_array()AnewtContainer::_get()AnewtContainer::__get()AnewtContainer::keys()AnewtContainer::clear()AnewtContainer::_keys()AnewtContainer::_set()