PHP Class phpbb\textformatter\s9e\utils

Inheritance: implements phpbb\textformatter\utils_interface
Afficher le fichier Open project: phpbb/phpbb Class Usage Examples

Méthodes publiques

Méthode Description
clean_formatting ( string $xml ) : string Replace BBCodes and other formatting elements with whitespace
generate_quote ( $text, array $attributes = [] )
get_outermost_quote_authors ( string $xml ) : string[] Get a list of quote authors, limited to the outermost quotes
remove_bbcode ( string $xml, string $bbcode_name, integer $depth ) : string Remove given BBCode and its content, at given nesting depth
unparse ( string $xml ) : string Return a parsed text to its original form

Méthodes protégées

Méthode Description
enquote ( string $str ) : string Return given string between quotes

Method Details

clean_formatting() public méthode

NOTE: preserves smilies as text
public clean_formatting ( string $xml ) : string
$xml string Parsed text
Résultat string Plain text

enquote() protected méthode

Will use either single- or double- quotes depending on whichever requires less escaping. Quotes and backslashes are escaped with backslashes where necessary
protected enquote ( string $str ) : string
$str string Original string
Résultat string Escaped string within quotes

generate_quote() public méthode

public generate_quote ( $text, array $attributes = [] )
$attributes array

get_outermost_quote_authors() public méthode

Get a list of quote authors, limited to the outermost quotes
public get_outermost_quote_authors ( string $xml ) : string[]
$xml string Parsed text
Résultat string[] List of authors

remove_bbcode() public méthode

Remove given BBCode and its content, at given nesting depth
public remove_bbcode ( string $xml, string $bbcode_name, integer $depth ) : string
$xml string Parsed text
$bbcode_name string BBCode's name
$depth integer Minimum nesting depth (number of parents of the same name)
Résultat string Parsed text

unparse() public méthode

Return a parsed text to its original form
public unparse ( string $xml ) : string
$xml string Parsed text
Résultat string Original plain text