\Anax\ContentCTextFilter

Filter and format content.

Summary

Methods
Properties
Constants
configure()
setDI()
doFilter()
bbcode2html()
makeClickable()
markdown()
nl2br()
shortCode()
No public properties found
No constants found
shortCodeInit()
shortCodeFigure()
shortCodeBaseurl()
shortCodeRelurl()
shortCodeAsset()
$di
N/A
No private methods found
$config
N/A

Properties

$di

$di : 

Properties

Type

$config

$config : 

Properties

Type

Methods

configure()

configure(\Anax\array/string  $what) : $this

Read configuration from file or array'.

Parameters

\Anax\array/string $what

is an array with key/value config options or a file

 to be included which returns such an array.

Returns

$this —

for chaining.

setDI()

setDI(\Anax\DI\class  $di) : $this

Set the service container to use

Parameters

\Anax\DI\class $di

a service container

Returns

$this

doFilter()

doFilter(string  $text, string  $filters) : string

Call each filter.

Parameters

string $text

the text to filter.

string $filters

as comma separated list of filter.

Returns

string —

the formatted text.

bbcode2html()

bbcode2html(string  $text) : string

Helper, BBCode formatting converting to HTML.

Parameters

string $text

The text to be converted.

Returns

string —

the formatted text.

makeClickable()

makeClickable(string  $text) : string

Make clickable links from URLs in text.

Parameters

string $text

the text that should be formatted.

Returns

string —

with formatted anchors.

markdown()

markdown(string  $text) : string

Format text according to Markdown syntax.

Parameters

string $text

the text that should be formatted.

Returns

string —

as the formatted html-text.

nl2br()

nl2br(string  $text) : string

For convenience access to nl2br

Parameters

string $text

text to be converted.

Returns

string —

the formatted text.

shortCode()

shortCode(string  $text) : string

Shortcode to to quicker format text as HTML.

Parameters

string $text

text to be converted.

Returns

string —

the formatted text.

shortCodeInit()

shortCodeInit(string  $options) : array

Init shortcode handling by preparing the option list to an array, for those using arguments.

Parameters

string $options

for the shortcode.

Returns

array —

with all the options.

shortCodeFigure()

shortCodeFigure(string  $options) : array

Shortcode for <figure>.

Usage example: [FIGURE src="img/home/me.jpg" caption="Me" alt="Bild på mig" nolink="nolink"]

Parameters

string $options

for the shortcode.

Returns

array —

with all the options.

shortCodeBaseurl()

shortCodeBaseurl() : array

Shortcode for adding BASEURL to links.

Usage example: [BASEURL]

Returns

array —

with all the options.

shortCodeRelurl()

shortCodeRelurl() : array

Shortcode for adding RELURL to links.

Usage example: [RELURL]

Returns

array —

with all the options.

shortCodeAsset()

shortCodeAsset() : array

Shortcode for adding RELURL to links.

Usage example: [RELURL]

Returns

array —

with all the options.