class JHtml


Located at : UKNOWVA_ROOT/libraries/joomla/html/html.php

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

static mixed
_(string $key)

Class loader method

static boolean
register(string $key, string $function)

Registers a function to be called with a specific key

static boolean
unregister(string $key)

Removes a key for a method from registry.

static boolean
isRegistered(string $key)

Test if the key is registered.

static string
link(string $url, string $text, array $attribs = null)

Write a element

static string
iframe(string $url, string $name, array $attribs = null, string $noFrames = '')

Write an iframe element

static string
image($file, $alt, $attribs = null, $relative = false, $path_only = false)

Write a element

static mixed
stylesheet(string $file, array $attribs = array(), boolean $relative = false, boolean $path_only = false, boolean $detect_browser = true)

Write a element

static mixed
script(string $file, boolean $framework = false, boolean $relative = false, boolean $path_only = false, boolean $detect_browser = true)

Write a element

static void
core(boolean $debug = null)

No description

static void
setFormatOptions(array $options)

Set format related options.

static string
date($input = 'now', $format = null, $tz = true, $gregorian = false)

Returns formated date according to a given format and time zone.

static string
tooltip($tooltip, $title = '', $image = 'tooltip.png', $text = '', $href = '', $alt = 'Tooltip', $class = 'hasTip')

Creates a tooltip with an image as button

static 
calendar(string $value, string $name, string $id, string $format = '%Y-%m-%d', array $attribs = null)

Displays a calendar control field

static array
addIncludePath(string $path = '')

Add a directory where JHtml should search for helpers. You may either pass a string or an array of directories.

Details

at line 97
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

Parameters

string $key The name of helper method to load, (prefix).(class).function prefix and class are optional and can be used to load custom html helpers.

Return Value

mixed JHtml::call($function, $args) or False on error

at line 156
static boolean register(string $key, string $function)

Registers a function to be called with a specific key

Parameters

string $key The name of the key
string $function Function or method

Return Value

boolean True if the function is callable

at line 175
static boolean unregister(string $key)

Removes a key for a method from registry.

Parameters

string $key The name of the key

Return Value

boolean True if a set key is unset

at line 194
static boolean isRegistered(string $key)

Test if the key is registered.

Parameters

string $key The name of the key

Return Value

boolean True if the key is registered.

Write a element

Parameters

string $url The relative URL to use for the href attribute
string $text The target attribute to use
array $attribs An associative array of attributes to add

Return Value

string string

at line 257
static string iframe(string $url, string $name, array $attribs = null, string $noFrames = '')

Write an iframe element

Parameters

string $url The relative URL to use for the src attribute
string $name The target attribute to use
array $attribs An associative array of attributes to add
string $noFrames The message to display if the iframe tag is not supported

Return Value

string iframe element or message if not supported

at line 405
static string image($file, $alt, $attribs = null, $relative = false, $path_only = false)

Write a element

Parameters

$file
$alt
$attribs
$relative
$path_only

Return Value

string

at line 442
static mixed stylesheet(string $file, array $attribs = array(), boolean $relative = false, boolean $path_only = false, boolean $detect_browser = true)

Write a element

Parameters

string $file path to file
array $attribs attributes to be added to the stylesheet
boolean $relative path to file is relative to /media folder
boolean $path_only return the path to the file only
boolean $detect_browser detect browser to include specific browser css files will try to include file, filebrowser, filebrowsermajor, filebrowsermajorminor

Return Value

mixed nothing if $path_only is false, null, path or array of path if specific css browser files were detected

See also

JBrowser

at line 493
static mixed script(string $file, boolean $framework = false, boolean $relative = false, boolean $path_only = false, boolean $detect_browser = true)

Write a element

Parameters

string $file path to file
boolean $framework load the JS framework
boolean $relative path to file is relative to /media folder
boolean $path_only return the path to the file only
boolean $detect_browser detect browser to include specific browser js files

Return Value

mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected

See also

JHtml::stylesheet

at line 541
static void core(boolean $debug = null)

Parameters

boolean $debug True if debugging is enabled.

Return Value

void

at line 565
static void setFormatOptions(array $options)

Set format related options.

Updates the formatOptions array with all valid values in the passed array. See {see JHtml::$formatOptions} for details.

Parameters

array $options Option key/value pairs.

Return Value

void

at line 586
static string date($input = 'now', $format = null, $tz = true, $gregorian = false)

Returns formated date according to a given format and time zone.

Parameters

$input
$format
$tz
$gregorian

Return Value

string A date translated by the given format and time zone.

See also

strftime

at line 652
static string tooltip($tooltip, $title = '', $image = 'tooltip.png', $text = '', $href = '', $alt = 'Tooltip', $class = 'hasTip')

Creates a tooltip with an image as button

Parameters

$tooltip
$title
$image
$text
$href
$alt
$class

Return Value

string

at line 712
static calendar(string $value, string $name, string $id, string $format = '%Y-%m-%d', array $attribs = null)

Displays a calendar control field

Parameters

string $value The date value
string $name The name of the text field
string $id The id of the text field
string $format The date format
array $attribs Additional HTML attributes

at line 771
static array addIncludePath(string $path = '')

Add a directory where JHtml should search for helpers. You may either pass a string or an array of directories.

Parameters

string $path A path to search.

Return Value

array An array with directory elements