\Horde_Text_Filter_Bbcode

The Horde_Text_Filter_Bbcode:: class finds bbcode-style markup (see below) in a block of text and turns it into HTML.

Parameters:

entities - (boolean) Before replacing bbcode with HTML tags, replace HTML
           entities?
           DEFAULT: false

Supported bbcode:

    [b]Bold Text[/b]
    [i]Italics Text[/i]
    [u]Underlined Text[/u]
    [quote]Quoted Text[/quote]
    [center]Centered Text[/center]

    List of items
    [list]
    [*] Item one
    [*] Item two
    [/list]

    Numbered list
    [numlist]
    [*] Item one
    [*] Item two
    [/numlist]

    [url]http://www.horde.org[/url] -> Link to the address using the
        address itself for the text.  You can specify the protocol: http or
        https and the port.
    [url]www.horde.org[/url] -> Link to the address using the address
        itself for the text.  You can specify the port.  The protocol is by
        default http.
    [url=http://www.horde.org]Link to Horde[/url] -> Link to the address
        using "Link to Horde" for the text.  You can specify the protocol:
        http or https and the port.
    [url=www.horde.org]Link to Horde[/url] -> Link to the address using
        "Link to Horde" for the text.  You can specify the port.  The
        protocol is by default http
    [email]cpedrinaci@yahoo.es[/email] -> sets a mailto link.
    [email=cpedrinaci@yahoo.es]Mail to Carlos[/email] -> Sets a mailto link
        and the text is "Mail to Carlos".

Copyright 2003-2017 Horde LLC (http://www.horde.org/)

Email validation based on Chuck Hagenbuch's Mail_RFC822::isValidInetAddress().

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
preProcess()
getPatterns()
postProcess()
No public properties found
No constants found
_link()
$_params
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Filter parameters.

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Any parameters that the filter instance needs.

preProcess()

preProcess(string  $text) : string

Executes any code necessary before applying the filter patterns.

Parameters

string $text

The text before the filtering.

Returns

string —

The modified text.

getPatterns()

getPatterns() : array

Returns a hash with replace patterns.

Returns

array —

Patterns hash.

postProcess()

postProcess(string  $text) : string

Executes any code necessaray after applying the filter patterns.

Parameters

string $text

The text after the filtering.

Returns

string —

The modified text.

_link()

_link(  $url,   $title) : string

Return link for use in getPatterns() regexp.

Parameters

$url
$title

Returns

string —

The opening tag.