rcube_text2html

Converts plain text to HTML

package

Framework

subpackage

Utils

Methods

Constructor.

__construct(string $source = '', boolean $from_file = false, array $config = array()) 

If the plain text source string (or file) is supplied, the class will instantiate with that source propagated, all that has to be done it to call get_html().

Arguments

$source

string

Plain text

$from_file

boolean

Indicates $source is a file to pull content from

$config

array

Class configuration

Loads source text into memory, either from $source string or a file.

set_text(string $source, boolean $from_file = false) 

Arguments

$source

string

Plain text

$from_file

boolean

Indicates $source is a file to pull content from

Returns the HTML content.

get_html() : string

Response

string

HTML content

Prints the HTML.

print_html() 

Workhorse function that does actual conversion (calls _converter() method).

_convert() 

Workhorse function that does actual conversion.

_converter($text) 

Arguments

$text

Converts spaces in line of text

_convert_line($text, $is_flowed) 

Arguments

$text

$is_flowed

Properties

Contains the HTML content after conversion.

html : string
var

Type(s)

string

Contains the plain text.

text : string
var

Type(s)

string

Configuration

config : array
var

Type(s)

array