public 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
- $key
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.
Returns
mixed - Result of JHtml::call($function, $args)
Throws
Since
1.5
|
public static
boolean
|
#
register( string $key, string $function )
Registers a function to be called with a specific key
Registers a function to be called with a specific key
Parameters
- $key
string - $key The name of the key
- $function
string - $function Function or method
Returns
boolean - True if the function is callable
Since
1.6
|
public static
boolean
|
#
unregister( string $key )
Removes a key for a method from registry.
Removes a key for a method from registry.
Parameters
- $key
string - $key The name of the key
Returns
boolean - True if a set key is unset
Since
1.6
|
public static
boolean
|
#
isRegistered( string $key )
Test if the key is registered.
Test if the key is registered.
Parameters
- $key
string - $key The name of the key
Returns
boolean - True if the key is registered.
Since
1.6
|
protected static
mixed
|
#
call( callable $function, array $args )
Function caller method
Parameters
- $function
callable - $function Function or method to call
- $args
array - $args Arguments to be passed to function
Returns
mixed - Function result or false on error.
Throws
Since
1.6
Link
|
public static
string
|
#
link( string $url, string $text, array|string $attribs = null )
Write a <a> element
Parameters
- $url
string - $url The relative URL to use for the href attribute
- $text
string - $text The target attribute to use
- $attribs
array|string - $attribs Attributes to be added to the <a> element
Returns
string
Since
1.5
|
public static
string
|
#
iframe( string $url, string $name, array|string $attribs = null, string $noFrames = '' )
Write a <iframe> element
Parameters
- $url
string - $url The relative URL to use for the src attribute.
- $name
string - $name The target attribute to use.
- $attribs
array|string - $attribs Attributes to be added to the <iframe> element
- $noFrames
string - $noFrames The message to display if the iframe tag is not supported.
Returns
string
Since
1.5
|
protected static
string
|
#
getMd5Version( string $path )
Include version with MD5SUM file in path.
Include version with MD5SUM file in path.
Deprecated
4.0 Usage of MD5SUM files is deprecated, use version instead.
Parameters
- $path
string - $path Folder name to search into (images, css, js, ...).
Returns
string - Query string to add.
Since
3.7.0
|
protected static
array
|
#
includeRelativeFiles( string $folder, string $file, boolean $relative, boolean $detect_browser, boolean $detect_debug )
Compute the files to be included
Compute the files to be included
Parameters
- $folder
string - $folder Folder name to search in (i.e. images, css, js).
- $file
string - $file Path to file.
- $relative
boolean - $relative Flag if the path to the file is relative to the /media folder (and
searches in template).
- $detect_browser
boolean - $detect_browser Flag if the browser should be detected to include specific
browser files.
- $detect_debug
boolean - $detect_debug Flag if debug mode is enabled to include uncompressed files if
debug is on.
Returns
array - files to be included.
Since
1.6
See
|
public static
string
|
#
image( string $file, string $alt, array|string $attribs = null, boolean $relative = false, integer $returnPath = 0 )
Write a <img> element
Parameters
- $file
string - $file The relative or absolute URL to use for the src attribute.
- $alt
string - $alt The alt text.
- $attribs
array|string - $attribs Attributes to be added to the <img> element
- $relative
boolean - $relative Flag if the path to the file is relative to the /media folder (and
searches in template).
- $returnPath
integer - $returnPath Defines the return value for the method: -1: Returns a
<img> tag without looking for relative files 0: Returns a
<img> tag while searching for relative files 1: Returns the
file path to the image while searching for relative files
Returns
string
Since
1.5
|
public static
array|string|null
|
#
stylesheet( string $file, array $options = array(), array $attribs = array() )
Write a <link> element to load a CSS file
Write a <link> element to load a CSS file
Deprecated
4.0 The (file, attribs, relative, pathOnly, detectBrowser, detectDebug) method
signature is deprecated, use (file, options, attributes) instead.
Parameters
- $file
string - $file Path to file
- $options
array - $options Array of options. Example: array('version' => 'auto', 'conditional'
=> 'lt IE 9')
- $attribs
array - $attribs Array of attributes. Example: array('id' => 'scriptid', 'async'
=> 'async', 'data-test' => 1)
Returns
array|string|null - nothing if $returnPath is false, null, path or array of path if specific CSS
browser files were detected
Since
1.5
See
|
public static
array|string|null
|
#
script( string $file, array $options = array(), array $attribs = array() )
Write a <script> element to load a JavaScript file
Write a <script> element to load a JavaScript file
Deprecated
4.0 The (file, framework, relative, pathOnly, detectBrowser, detectDebug) method
signature is deprecated, use (file, options, attributes) instead.
Parameters
- $file
string - $file Path to file.
- $options
array - $options Array of options. Example: array('version' => 'auto', 'conditional'
=> 'lt IE 9')
- $attribs
array - $attribs Array of attributes. Example: array('id' => 'scriptid', 'async'
=> 'async', 'data-test' => 1)
Returns
array|string|null - Nothing if $returnPath is false, null, path or array of path if specific
JavaScript browser files were detected
Since
1.5
See
|
public static
|
#
setFormatOptions( array $options )
Set format related options.
Set format related options.
Updates the formatOptions array with all valid values in the passed
array.
Parameters
- $options
array - $options Option key/value pairs.
Since
1.5
See
|
public 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.
Returns formated date according to a given format and time zone.
Parameters
- $input
string - $input String in a format accepted by date(), defaults to "now".
- $format
string - $format The date format specification string (see PHP_MANUAL#date).
- $tz
mixed - $tz Time zone to be used for the date. Special cases: boolean true for user
setting, boolean false for server setting.
- $gregorian
boolean - $gregorian True to use Gregorian calendar.
Returns
string - A date translated by the given format and time zone.
Since
1.5
See
strftime
|
public 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
Creates a tooltip with an image as button
Parameters
- $tooltip
string - $tooltip The tip string.
- $title
mixed - $title The title of the tooltip or an associative array with keys contained in
{'title','image','text','href','alt'} and values corresponding to parameters of
the same name.
- $image
string - $image The image for the tip, if no text is provided.
- $text
string - $text The text for the tip.
- $href
string - $href A URL that will be used to create the link.
- $alt
string - $alt The alt attribute for img tag.
- $class
string - $class CSS class for the tool tip.
Returns
string
Since
1.5
|
public 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
Converts a double colon separated string or 2 separate strings to a string
ready for bootstrap tooltips
Parameters
- $title
string - $title The title of the tooltip (or combined '::' separated string).
- $content
string - $content The content to tooltip.
- $translate
boolean - $translate If true will pass texts through JText.
- $escape
boolean - $escape If true will pass texts through htmlspecialchars.
Returns
string - The tooltip string
Since
3.1.2
|
public static
string
|
#
calendar( string $value, string $name, string $id, string $format = '%Y-%m-%d', mixed $attribs = array() )
Displays a calendar control field
Displays a calendar control field
Parameters
- $value
string - $value The date value
- $name
string - $name The name of the text field
- $id
string - $id The id of the text field
- $format
string - $format The date format
- $attribs
mixed - $attribs Additional HTML attributes The array can have the following keys:
readonly Sets the readonly parameter for the input tag disabled Sets the
disabled parameter for the input tag autofocus Sets the autofocus parameter for
the input tag autocomplete Sets the autocomplete parameter for the input tag
filter Sets the filter for the input tag
Returns
string - HTML markup for a calendar field
Since
1.5
|
public 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.
Add a directory where JHtml should search for helpers. You may either pass a
string or an array of directories.
Parameters
- $path
string - $path A path to search.
Returns
array - An array with directory elements
Since
1.5
|
public static
string
|
#
getJSObject( array $array = array() )
Internal method to get a JavaScript object notation string from an array
Internal method to get a JavaScript object notation string from an array
Deprecated
4.0 Use json_encode() or
Joomla\Registry\Registry::toString('json') instead
Parameters
- $array
array - $array The array to convert to JavaScript object notation
Returns
string - JavaScript object notation representation of the array
Since
3.0
|