View
in package
Rendering of HTML and plain text output
Generally, View
encapsulates $plugin_tx
of the plugin.
In simple cases, it can be used to compose a message (XH_message()
).
In more complex cases, it it used to render a view template, to which
arbitrary values can be passed.
Tags
Table of Contents
Methods
- __construct() : mixed
- checked() : string
- Renders a boolean checked attribute
- date() : string
- esc() : string
- json() : string
- message() : string
- plain() : string
- plural() : string
- pmessage() : string
- raw() : string
- render() : string
- selected() : string
- Renders a boolean selected attribute
- text() : string
Methods
__construct()
public
__construct(string $templateFolder, array<string, string> $text) : mixed
Parameters
- $templateFolder : string
- $text : array<string, string>
checked()
Renders a boolean checked attribute
public
checked(string|bool $current[, string|array<int, string> $checked = [] ]) : string
The attribute is set if $current
is true
or is (in) $checked
.
Parameters
- $current : string|bool
- $checked : string|array<int, string> = []
Tags
Return values
stringdate()
public
date(string $key, int $timestamp) : string
Parameters
- $key : string
- $timestamp : int
Tags
Return values
stringesc()
public
esc(scalar $string) : string
Parameters
- $string : scalar
Tags
Return values
stringjson()
public
json(mixed $value) : string
Parameters
- $value : mixed
Tags
Return values
stringmessage()
public
message(string $type, string $key, scalar ...$args) : string
Parameters
- $type : string
- $key : string
- $args : scalar
Return values
stringplain()
public
plain(string $key, scalar ...$args) : string
Parameters
- $key : string
- $args : scalar
Return values
stringplural()
public
plural(string $key, int $count, scalar ...$args) : string
Parameters
- $key : string
- $count : int
- $args : scalar
Tags
Return values
stringpmessage()
public
pmessage(string $type, string $key, int $count, scalar ...$args) : string
Parameters
- $type : string
- $key : string
- $count : int
- $args : scalar
Tags
Return values
stringraw()
public
raw(string $string) : string
Parameters
- $string : string
Return values
stringrender()
public
render(string $_template, array<string, mixed> $_data) : string
Parameters
- $_template : string
- $_data : array<string, mixed>
Return values
stringselected()
Renders a boolean selected attribute
public
selected(string $current, string|array<int, string> $selected) : string
The attribute is set if $current
is (in) $selected
.
Parameters
- $current : string
- $selected : string|array<int, string>
Tags
Return values
stringtext()
public
text(string $key, scalar ...$args) : string
Parameters
- $key : string
- $args : scalar