HTMLHelper
class HTMLHelper
Utility class for all HTML drawing classes
Properties
static array | $formatOptions | Option values related to the generation of HTML output. Recognized options are: fmtDepth, integer. The current indent depth. |
Methods
Class loader method
Registers a function to be called with a specific key
Removes a key for a method from registry.
Test if the key is registered.
Write a <a>
element
Write a <iframe>
element
Write a <img>
element
Write a <link>
element to load a CSS file
Write a <script>
element to load a JavaScript file
Set format related options.
Returns formated date according to a given format and time zone.
Creates a tooltip with an image as button
Converts a double colon separated string or 2 separate strings to a string ready for bootstrap tooltips
Displays a calendar control field
Add a directory where HTMLHelper should search for helpers. You may either pass a string or an array of directories.
Internal method to get a JavaScript object notation string from an array
Details
static
mixed
_(
string $key)
Class loader method
Additional arguments may be supplied and are passed to the sub-class. Additional include paths are also able to be specified for third-party use
static
boolean
register(
string $key,
string $function)
Registers a function to be called with a specific key
static
string
iframe(
string $url,
string $name,
array|string $attribs = null,
string $noFrames = '')
Write a <iframe>
element
static
string
image(
string $file,
string $alt,
array|string $attribs = null,
boolean $relative = false,
integer $returnPath)
Write a <img>
element
static
array|string|null
stylesheet(
string $file,
array $options = array(),
array $attribs = array())
Write a <link>
element to load a CSS file
static
array|string|null
script(
string $file,
array $options = array(),
array $attribs = array())
Write a <script>
element to load a JavaScript file
static
void
setFormatOptions(
array $options)
Set format related options.
Updates the formatOptions array with all valid values in the passed array.
static
string
date(
string $input = 'now',
string $format = null,
mixed $tz = true,
boolean $gregorian = false)
Returns formated date according to a given format and time zone.
static
string
tooltip(
string $tooltip,
mixed $title = '',
string $image = 'tooltip.png',
string $text = '',
string $href = '',
string $alt = 'Tooltip',
string $class = 'hasTooltip')
Creates a tooltip with an image as button
static
string
tooltipText(
string $title = '',
string $content = '',
boolean $translate = true,
boolean $escape = true)
Converts a double colon separated string or 2 separate strings to a string ready for bootstrap tooltips
static
string
calendar(
string $value,
string $name,
string $id,
string $format = '%Y-%m-%d',
mixed $attribs = array())
Displays a calendar control field