PHP Класс phpbb\textformatter\s9e\utils

Наследование: implements phpbb\textformatter\utils_interface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
enquote ( string $str ) : string Return given string between quotes

Описание методов

clean_formatting() публичный Метод

NOTE: preserves smilies as text
public clean_formatting ( string $xml ) : string
$xml string Parsed text
Результат string Plain text

enquote() защищенный Метод

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
Результат string Escaped string within quotes

generate_quote() публичный Метод

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

get_outermost_quote_authors() публичный Метод

Get a list of quote authors, limited to the outermost quotes
public get_outermost_quote_authors ( string $xml ) : string[]
$xml string Parsed text
Результат string[] List of authors

remove_bbcode() публичный Метод

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)
Результат string Parsed text

unparse() публичный Метод

Return a parsed text to its original form
public unparse ( string $xml ) : string
$xml string Parsed text
Результат string Original plain text