LDAP Account Manager

htmlOutputText extends htmlElement
in package

Prints the text and escapes contained HTML code by default.

Table of Contents

ALIGN_BOTTOM  = 3
align to bottom
ALIGN_CENTER  = 4
align to center
ALIGN_LEFT  = 1
align to left
ALIGN_RIGHT  = 2
align to right
ALIGN_TOP  = 0
align to top
$alignment  : mixed
alignment when inside a table
$colspan  : mixed
colspan if inside a table
$rowspan  : mixed
rowspan if inside a table
$cssClasses  : mixed
CSS classes
$tableCellCssClasses  : mixed
table cell CSS classes
$accessibilityLabel  : string|null
accessibility label
$dataAttributes  : mixed
data attributes
$escapeHTML  : mixed
specifies if HTML code should be escaped
$isBold  : mixed
bold text
$isPreformatted  : mixed
preformatted
$markAsRequired  : mixed
mark as required
$noWrap  : mixed
no wrap
$string  : mixed
the text to print
$title  : mixed
title
__construct()  : mixed
Constructor.
addDataAttribute()  : mixed
Adds a data attribute.
generateHTML()  : array<string|int, mixed>
Prints the HTML code for this element.
getAccessibilityMarkup()  : string
Returns the markup for the accessibility data.
getAlignmentString()  : string
Returns the HTML attributes for the alignment.
getColspanString()  : string
Returns the HTML attribute for the colspan.
getCSSClasses()  : array<string|int, mixed>
Returns the CSS classes of this element.
getRowspanString()  : string
Returns the HTML attribute for the rowspan.
getTableCellCSSClasses()  : array<string|int, mixed>
Returns the CSS classes of the surrounding table cell for this element.
setAccessibilityLabel()  : void
Sets the accessibility label.
setCSSClasses()  : mixed
Adds CSS classes to this element.
setIsBold()  : mixed
Specifies if the whole text should be printed in bold.
setMarkAsRequired()  : mixed
Adds a marker that indicates a required field.
setNoWrap()  : mixed
Specifies if word wrap is allowed for this text.
setPreformatted()  : mixed
Sets if the text is preformatted.
setTableCellCSSClasses()  : mixed
Adds CSS classes to the surrounding table cell for this element.
setTitle()  : void
Sets a title for this text.
getDataAttributesAsString()  : string
Returns the data attributes as rendered string.

Constants

ALIGN_BOTTOM

align to bottom

public mixed ALIGN_BOTTOM = 3

ALIGN_CENTER

align to center

public mixed ALIGN_CENTER = 4

ALIGN_LEFT

align to left

public mixed ALIGN_LEFT = 1

ALIGN_RIGHT

align to right

public mixed ALIGN_RIGHT = 2

ALIGN_TOP

align to top

public mixed ALIGN_TOP = 0

Properties

$alignment

alignment when inside a table

public mixed $alignment

$colspan

colspan if inside a table

public mixed $colspan

$rowspan

rowspan if inside a table

public mixed $rowspan

$cssClasses

CSS classes

protected mixed $cssClasses = []

$tableCellCssClasses

table cell CSS classes

protected mixed $tableCellCssClasses = []

$accessibilityLabel

accessibility label

private string|null $accessibilityLabel = \null

$dataAttributes

data attributes

private mixed $dataAttributes = []

$escapeHTML

specifies if HTML code should be escaped

private mixed $escapeHTML

$isBold

bold text

private mixed $isBold = \false

$isPreformatted

preformatted

private mixed $isPreformatted = \false

$markAsRequired

mark as required

private mixed $markAsRequired = \false

$noWrap

no wrap

private mixed $noWrap = \false

$string

the text to print

private mixed $string

$title

title

private mixed $title

Methods

__construct()

Constructor.

public __construct(string $string[, bool $escapeHTML = true ][, bool $markAsRequired = false ]) : mixed
Parameters
$string : string

output text

$escapeHTML : bool = true

escape HTML code (default yes)

$markAsRequired : bool = false

mark text like a required field

Return values
mixed

addDataAttribute()

Adds a data attribute.

public addDataAttribute(string $key, string $value) : mixed
Parameters
$key : string

attribute name (without "data-")

$value : string

attribute value

Return values
mixed

generateHTML()

Prints the HTML code for this element.

public generateHTML(string $module, array<string|int, mixed> $input, array<string|int, mixed> $values, bool $restricted, string $scope) : array<string|int, mixed>
Parameters
$module : string

Name of account module

$input : array<string|int, mixed>

List of meta-HTML elements

$values : array<string|int, mixed>

List of values which override the defaults in $input (name => value)

$restricted : bool

If true then no buttons will be displayed

$scope : string

Account type

Return values
array<string|int, mixed>

List of input field names and their type (name => type)

getAccessibilityMarkup()

Returns the markup for the accessibility data.

public getAccessibilityMarkup() : string
Return values
string

markup to be included in HTML tag (starting with space)

getAlignmentString()

Returns the HTML attributes for the alignment.

public getAlignmentString() : string
Return values
string

alignment HTML attributes (e.g. align="right" valign="top")

getColspanString()

Returns the HTML attribute for the colspan.

public getColspanString() : string
Return values
string

colspan HTML attribute (e.g. colspan=3)

getCSSClasses()

Returns the CSS classes of this element.

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

$classes CSS class names

getRowspanString()

Returns the HTML attribute for the rowspan.

public getRowspanString() : string
Return values
string

rowspan HTML attribute (e.g. rowspan=3)

getTableCellCSSClasses()

Returns the CSS classes of the surrounding table cell for this element.

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

CSS classes

setAccessibilityLabel()

Sets the accessibility label.

public setAccessibilityLabel(string|null $accessibilityLabel) : void
Parameters
$accessibilityLabel : string|null

label

Return values
void

setCSSClasses()

Adds CSS classes to this element.

public setCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
$classes : array<string|int, mixed>

CSS class names

Return values
mixed

setIsBold()

Specifies if the whole text should be printed in bold.

public setIsBold(bool $isBold) : mixed
Parameters
$isBold : bool

bold text

Return values
mixed

setMarkAsRequired()

Adds a marker that indicates a required field.

public setMarkAsRequired(bool $markAsRequired) : mixed
Parameters
$markAsRequired : bool

add marker

Return values
mixed

setNoWrap()

Specifies if word wrap is allowed for this text.

public setNoWrap(bool $noWrap) : mixed
Parameters
$noWrap : bool

no wrapping if set to true (default false)

Return values
mixed

setPreformatted()

Sets if the text is preformatted.

public setPreformatted([bool $preformatted = true ]) : mixed
Parameters
$preformatted : bool = true

is preformatted (default true)

Return values
mixed

setTableCellCSSClasses()

Adds CSS classes to the surrounding table cell for this element.

public setTableCellCSSClasses(array<string|int, mixed> $classes) : mixed
Parameters
$classes : array<string|int, mixed>

CSS class names

Return values
mixed

setTitle()

Sets a title for this text.

public setTitle(string|null $title) : void
Parameters
$title : string|null

title

Return values
void

getDataAttributesAsString()

Returns the data attributes as rendered string.

protected getDataAttributesAsString() : string
Return values
string

data attributes

Search results