HtmlOutputHelper
in package
This class provides a few utility functions for easily generating HTML for the browser plugin.
Tags
Table of Contents
- $baseUri : string
- Link to the root of the application.
- $namespaceMap : array<string|int, mixed>
- List of xml namespaces.
- __construct() : mixed
- Creates the object.
- fullUrl() : string
- Generates a 'full' url based on a relative one.
- h() : string
- Escape string for HTML output.
- link() : string
- Generates a full <a>-tag.
- xmlName() : string
- This method takes an xml element in clark-notation, and turns it into a shortened version with a prefix, if it was a known namespace.
Properties
$baseUri
Link to the root of the application.
protected
string
$baseUri
$namespaceMap
List of xml namespaces.
protected
array<string|int, mixed>
$namespaceMap
Methods
__construct()
Creates the object.
public
__construct(string $baseUri, array<string|int, mixed> $namespaceMap) : mixed
baseUri must point to the root of the application. This will be used to easily generate links.
The namespaceMap contains an array with the list of xml namespaces and their prefixes. WebDAV uses a lot of XML with complex namespaces, so that can be used to make output a lot shorter.
Parameters
- $baseUri : string
- $namespaceMap : array<string|int, mixed>
Return values
mixed —fullUrl()
Generates a 'full' url based on a relative one.
public
fullUrl(string $path) : string
For relative urls, the base of the application is taken as the reference url, not the 'current url of the current request'.
Absolute urls are left alone.
Parameters
- $path : string
Return values
string —h()
Escape string for HTML output.
public
h(scalar $input) : string
Parameters
- $input : scalar
Return values
string —link()
Generates a full <a>-tag.
public
link(string $url[, string $label = null ]) : string
Url is automatically expanded. If label is not specified, we re-use the url.
Parameters
- $url : string
- $label : string = null
Return values
string —xmlName()
This method takes an xml element in clark-notation, and turns it into a shortened version with a prefix, if it was a known namespace.
public
xmlName(string $element) : string
Parameters
- $element : string