ConvertToHtmlTrait
Trait ConvertToHtmlTrait.
Class to cast an input value to HTML.
Table of Contents
- fromArrayToHtml() : string
- Convert array to HTML string.
- fromBooleanToHtml() : string
- Convert boolean to HTML string.
- fromFileToHtml() : string
- Convert file to HTML string.
- fromFloatToHtml() : string
- Convert float to HTML string.
- fromHtmlToHtml() : string
- Convert an HTML string to HTML string.
- fromImageToHtml() : string
- Convert an image string to HTML string.
- fromIntegerToHtml() : string
- Convert integer to HTML string.
- fromJsonToHtml() : string
- Convert JSON string to HTML string.
- fromTextToHtml() : string
- Convert text to HTML string.
- fromUndefinedToHtml() : string
- Convert undefined to HTML.
- fromXmlToHtml() : string
- Convert XML string to HTML string.
- fromArrayToDataList() : string
- Convert array to HTML Data List string.
- wrapDataHtmlFormat() : string
- Wrap Data in HTML string wrapper.
Methods
fromArrayToHtml()
Convert array to HTML string.
public
fromArrayToHtml(array<string|int, mixed>|null $array) : string
If the array does not have a html element at the root, then the array will be converted to a data-list and will be appended to the body of the new HTML doc.
Parameters
- $array : array<string|int, mixed>|null
Return values
string —fromBooleanToHtml()
Convert boolean to HTML string.
public
fromBooleanToHtml(bool|null $boolean) : string
The boolean will be within a div in the body of the new HTML doc.
Parameters
- $boolean : bool|null
Return values
string —fromFileToHtml()
Convert file to HTML string.
public
fromFileToHtml( $file) : string
Parameters
Return values
string —fromFloatToHtml()
Convert float to HTML string.
public
fromFloatToHtml(float|null $float) : string
The float will be within a div in the body of the new HTML doc.
Parameters
- $float : float|null
Return values
string —fromHtmlToHtml()
Convert an HTML string to HTML string.
public
fromHtmlToHtml(string $html) : string
Parameters
- $html : string
Return values
string —fromImageToHtml()
Convert an image string to HTML string.
public
fromImageToHtml( $image) : string
Parameters
Return values
string —fromIntegerToHtml()
Convert integer to HTML string.
public
fromIntegerToHtml(int|float|null $integer) : string
The integer will be within a div in the body of the new HTML doc.
Parameters
- $integer : int|float|null
Return values
string —fromJsonToHtml()
Convert JSON string to HTML string.
public
fromJsonToHtml(string|null $json) : string
Parameters
- $json : string|null
Return values
string —fromTextToHtml()
Convert text to HTML string.
public
fromTextToHtml(string $text) : string
The text will be within a div in the body of the new HTML doc.
Parameters
- $text : string
Return values
string —fromUndefinedToHtml()
Convert undefined to HTML.
public
fromUndefinedToHtml( $data) : string
Creates an empty HTML doc.
Parameters
Return values
string —fromXmlToHtml()
Convert XML string to HTML string.
public
fromXmlToHtml(string $xml) : string
Parameters
- $xml : string
Return values
string —fromArrayToDataList()
Convert array to HTML Data List string.
protected
fromArrayToDataList(array<string|int, mixed> $array) : string
Parameters
- $array : array<string|int, mixed>
Return values
string —wrapDataHtmlFormat()
Wrap Data in HTML string wrapper.
protected
wrapDataHtmlFormat(string $body[, string $pageTitle = 'HTML generated by ApiOpenStudio' ]) : string
Parameters
- $body : string
-
Body content.
- $pageTitle : string = 'HTML generated by ApiOpenStudio'
-
HTML doc title.