PHP Класс Golonka\BBCode\BBCodeParser

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$parsers

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

Метод Описание
__construct ( )
except ( mixed $except = null ) : object Removes the parsers you want to exclude
getParsers ( ) : array List of chosen parsers
only ( mixed $only = null ) : object Limits the parsers to only those you specify
parse ( string $source, $caseInsensitive = false ) : string Parses the BBCode string
parseCaseInsensitive ( string $source ) : string Helper function to parse case insensitive
parseCaseSensitive ( string $source ) : string Helper function to parse case sensitive
setParser ( string $name, string $pattern, string $replace, string $content ) : void Sets the parser pattern and replace.
stripBBCodeTags ( string $source ) : string Remove all BBCode

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

Метод Описание
searchAndReplace ( string $pattern, string $replace, string $source ) : string Searches after a specified pattern and replaces it with provided structure

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

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

public __construct ( )

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

Removes the parsers you want to exclude
public except ( mixed $except = null ) : object
$except mixed parsers
Результат object BBCodeParser object

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

List of chosen parsers
public getParsers ( ) : array
Результат array array of parsers

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

Limits the parsers to only those you specify
public only ( mixed $only = null ) : object
$only mixed parsers
Результат object BBCodeParser object

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

Parses the BBCode string
public parse ( string $source, $caseInsensitive = false ) : string
$source string String containing the BBCode
Результат string Parsed string

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

Helper function to parse case insensitive
public parseCaseInsensitive ( string $source ) : string
$source string String containing the BBCode
Результат string Parsed text

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

Helper function to parse case sensitive
public parseCaseSensitive ( string $source ) : string
$source string String containing the BBCode
Результат string Parsed text

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

Searches after a specified pattern and replaces it with provided structure
protected searchAndReplace ( string $pattern, string $replace, string $source ) : string
$pattern string Search pattern
$replace string Replacement structure
$source string Text to search in
Результат string Parsed text

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

This can be used for new parsers or overwriting existing ones.
public setParser ( string $name, string $pattern, string $replace, string $content ) : void
$name string Parser name
$pattern string Pattern
$replace string Replace pattern
$content string Parsed text pattern
Результат void

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

Remove all BBCode
public stripBBCodeTags ( string $source ) : string
$source string
Результат string Parsed text

Описание свойств

$parsers публичное свойство

public $parsers