PHP Class Golonka\BBCode\BBCodeParser

Afficher le fichier Open project: golonka/bbcodeparser Class Usage Examples

Méthodes publiques

Свойство Type Description
$parsers

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
searchAndReplace ( string $pattern, string $replace, string $source ) : string Searches after a specified pattern and replaces it with provided structure

Method Details

__construct() public méthode

public __construct ( )

except() public méthode

Removes the parsers you want to exclude
public except ( mixed $except = null ) : object
$except mixed parsers
Résultat object BBCodeParser object

getParsers() public méthode

List of chosen parsers
public getParsers ( ) : array
Résultat array array of parsers

only() public méthode

Limits the parsers to only those you specify
public only ( mixed $only = null ) : object
$only mixed parsers
Résultat object BBCodeParser object

parse() public méthode

Parses the BBCode string
public parse ( string $source, $caseInsensitive = false ) : string
$source string String containing the BBCode
Résultat string Parsed string

parseCaseInsensitive() public méthode

Helper function to parse case insensitive
public parseCaseInsensitive ( string $source ) : string
$source string String containing the BBCode
Résultat string Parsed text

parseCaseSensitive() public méthode

Helper function to parse case sensitive
public parseCaseSensitive ( string $source ) : string
$source string String containing the BBCode
Résultat string Parsed text

searchAndReplace() protected méthode

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
Résultat string Parsed text

setParser() public méthode

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
Résultat void

stripBBCodeTags() public méthode

Remove all BBCode
public stripBBCodeTags ( string $source ) : string
$source string
Résultat string Parsed text

Property Details

$parsers public_oe property

public $parsers