Documentation

Horde_Text_Filter_Bbcode extends Horde_Text_Filter_Base
in package

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.

Tags
author

Carlos Pedrinaci cpedrinaci@yahoo.es

category

Horde

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

$_params  : array<string|int, mixed>
Filter parameters.
__construct()  : mixed
Constructor.
getPatterns()  : array<string|int, mixed>
Returns a hash with replace patterns.
postProcess()  : string
Executes any code necessaray after applying the filter patterns.
preProcess()  : string
Executes any code necessary before applying the filter patterns.
_link()  : string
Return link for use in getPatterns() regexp.

Properties

$_params

Filter parameters.

protected array<string|int, mixed> $_params = array('entities' => \false)

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

Any parameters that the filter instance needs.

Return values
mixed

getPatterns()

Returns a hash with replace patterns.

public getPatterns() : array<string|int, mixed>
Return values
array<string|int, mixed>

Patterns hash.

postProcess()

Executes any code necessaray after applying the filter patterns.

public postProcess(string $text) : string
Parameters
$text : string

The text after the filtering.

Return values
string

The modified text.

preProcess()

Executes any code necessary before applying the filter patterns.

public preProcess(string $text) : string
Parameters
$text : string

The text before the filtering.

Return values
string

The modified text.

Return link for use in getPatterns() regexp.

protected _link(mixed $url, mixed $title) : string
Parameters
$url : mixed
$title : mixed
Return values
string

The opening tag.

Search results