Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe HTMLHelper

Fonctions membres publiques statiques

static _ ($key)
 
static register ($key, $function)
 
static unregister ($key)
 
static isRegistered ($key)
 
static link ($url, $text, $attribs=null)
 
static iframe ($url, $name, $attribs=null, $noFrames='')
 
static image ($file, $alt, $attribs=null, $relative=false, $returnPath=0)
 
static stylesheet ($file, $options=array(), $attribs=array())
 
static script ($file, $options=array(), $attribs=array())
 
static setFormatOptions ($options)
 
static date ($input='now', $format=null, $tz=true, $gregorian=false)
 
static tooltip ($tooltip, $title='', $image='tooltip.png', $text='', $href='', $alt='Tooltip', $class='hasTooltip')
 
static tooltipText ($title='', $content='', $translate=true, $escape=true)
 
static calendar ($value, $name, $id, $format='%Y-%m-%d', $attribs=array())
 
static addIncludePath ($path='')
 
static getJSObject (array $array=array())
 

Attributs publics statiques

static $formatOptions = array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t")
 

Fonctions membres protégées statiques

static extract ($key)
 
static call ($function, $args)
 
static getMd5Version ($path)
 
static includeRelativeFiles ($folder, $file, $relative, $detectBrowser, $detectDebug)
 

Attributs protégés statiques

static $includePaths = array()
 
static $registry = array()
 

Description détaillée

Utility class for all HTML drawing classes

Depuis
1.5

Documentation des fonctions membres

◆ _()

static _ (   $key)
static

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

Paramètres
string$keyThe name of helper method to load, (prefix).(class).function prefix and class are optional and can be used to load custom html helpers.
Renvoie
mixed Result of HTMLHelper::call($function, $args)
Depuis
1.5
Exceptions

Références $className, $file, $function, $key, $path, $prefix, et JLoader\register().

Référencé par PlgEditorTinymce\onDisplay(), PlgEditorTinymce\onDisplayLegacy(), et Text\script().

◆ addIncludePath()

static addIncludePath (   $path = '')
static

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

Paramètres
string$pathA path to search.
Renvoie
array An array with directory elements
Depuis
1.5

Références $path.

◆ calendar()

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

Displays a calendar control field

Paramètres
string$valueThe date value
string$nameThe name of the text field
string$idThe id of the text field
string$formatThe date format
mixed$attribsAdditional 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
Renvoie
string HTML markup for a calendar field
Depuis
1.5

Références $attribs, $autocomplete, $autofocus, $class, $data, $direction, $disabled, $filter, $format, $hint, $id, $inputvalue, $name, $onchange, $readonly, $required, $value, elseif, Factory\getDbo(), Factory\getDocument(), Factory\getLanguage(), JPATH_ROOT, null, et LayoutHelper\render().

◆ call()

static call (   $function,
  $args 
)
staticprotected

Function caller method

Paramètres
callable$functionFunction or method to call
array$argsArguments to be passed to function
Renvoie
mixed Function result or false on error.

1.6

Références $function.

◆ date()

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

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

Paramètres
string$inputString in a format accepted by date(), defaults to "now".
string$formatThe date format specification string (see PHP_MANUAL#date).
mixed$tzTime zone to be used for the date. Special cases: boolean true for user setting, boolean false for server setting.
boolean$gregorianTrue to use Gregorian calendar.
Renvoie
string A date translated by the given format and time zone.
Voir également
strftime
Depuis
1.5

Références $date, $format, $input, elseif, Factory\getConfig(), Factory\getDate(), Factory\getLanguage(), Factory\getUser(), et null.

◆ extract()

static extract (   $key)
staticprotected

Method to extract a key

Paramètres
string$keyThe name of helper method to load, (prefix).(class).function prefix and class are optional and can be used to load custom html helpers.
Renvoie
array Contains lowercase key, prefix, file, function.
Depuis
1.6

Références $file, $key, $parts, et $prefix.

◆ getJSObject()

static getJSObject ( array  $array = array())
static

Internal method to get a JavaScript object notation string from an array

Paramètres
array$arrayThe array to convert to JavaScript object notation
Renvoie
string JavaScript object notation representation of the array
Depuis
3.0
Obsolète:
4.0 Use json_encode() or ‘Joomla::toString('json’)` instead

Références $key, Log\add(), elseif, json_encode, null, et Log\WARNING.

◆ getMd5Version()

static getMd5Version (   $path)
staticprotected

Include version with MD5SUM file in path.

Paramètres
string$pathFolder name to search into (images, css, js, ...).
Renvoie
string Query string to add.
Depuis
3.7.0
Obsolète:
4.0 Usage of MD5SUM files is deprecated, use version instead.

Références $path, Log\add(), et Log\WARNING.

◆ iframe()

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

Write a <iframe> element

Paramètres
string$urlThe relative URL to use for the src attribute.
string$nameThe target attribute to use.
array | string$attribsAttributes to be added to the <iframe> element
string$noFramesThe message to display if the iframe tag is not supported.
Renvoie
string
Depuis
1.5

Références $attribs, $name, $url, et ArrayHelper\toString().

◆ image()

static image (   $file,
  $alt,
  $attribs = null,
  $relative = false,
  $returnPath = 0 
)
static

Write a <img> element

Paramètres
string$fileThe relative or absolute URL to use for the src attribute.
string$altThe alt text.
array | string$attribsAttributes to be added to the <img> element
boolean$relativeFlag if the path to the file is relative to the /media folder (and searches in template).
integer$returnPathDefines 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
Renvoie
string|null HTML markup for the image, relative path to the image, or null if path is to be returned but image is not found
Depuis
1.5

Références $alt, $attribs, $file, null, et ArrayHelper\toString().

◆ includeRelativeFiles()

static includeRelativeFiles (   $folder,
  $file,
  $relative,
  $detectBrowser,
  $detectDebug 
)
staticprotected

Compute the files to be included

Paramètres
string$folderFolder name to search in (i.e. images, css, js).
string$filePath to file.
boolean$relativeFlag if the path to the file is relative to the /media folder (and searches in template).
boolean$detectBrowserFlag if the browser should be detected to include specific browser files.
boolean$detectDebugFlag if debug mode is enabled to include uncompressed files if debug is on.
Renvoie
array files to be included.
Voir également
JBrowser
Depuis
1.6

Références $extension, $file, $files, $path, $template, Uri\base(), Factory\getApplication(), Factory\getConfig(), Browser\getInstance(), JPATH_ROOT, JPATH_THEMES, et Uri\root().

◆ isRegistered()

static isRegistered (   $key)
static

Test if the key is registered.

Paramètres
string$keyThe name of the key
Renvoie
boolean True if the key is registered.
Depuis
1.6

Références $key.

◆ link()

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

Write a <a> element

Paramètres
string$urlThe relative URL to use for the href attribute
string$textThe target attribute to use
array | string$attribsAttributes to be added to the <a> element
Renvoie
string
Depuis
1.5

Références $attribs, $text, $url, et ArrayHelper\toString().

◆ register()

static register (   $key,
  $function 
)
static

Registers a function to be called with a specific key

Paramètres
string$keyThe name of the key
string$functionFunction or method
Renvoie
boolean True if the function is callable
Depuis
1.6

Références $function, et $key.

◆ script()

static script (   $file,
  $options = array(),
  $attribs = array() 
)
static

Write a <script> element to load a JavaScript file

Paramètres
string$filePath to file.
array$optionsArray of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9')
array$attribsArray of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1)
Renvoie
array|string|null Nothing if $returnPath is false, null, path or array of path if specific JavaScript browser files were detected
Voir également
HTMLHelper::stylesheet()
Depuis
1.5
Obsolète:
4.0 The (file, framework, relative, pathOnly, detectBrowser, detectDebug) method signature is deprecated, use (file, options, attributes) instead.

Références $attribs, $document, $file, $options, Log\add(), Factory\getDocument(), et Log\WARNING.

◆ setFormatOptions()

static setFormatOptions (   $options)
static

Set format related options.

Updates the formatOptions array with all valid values in the passed array.

Paramètres
array$optionsOption key/value pairs.
Renvoie
void
Voir également
HTMLHelper::$formatOptions
Depuis
1.5

Références $key, et $options.

◆ stylesheet()

static stylesheet (   $file,
  $options = array(),
  $attribs = array() 
)
static

Write a <link> element to load a CSS file

Paramètres
string$filePath to file
array$optionsArray of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9')
array$attribsArray of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1)
Renvoie
array|string|null nothing if $returnPath is false, null, path or array of path if specific CSS browser files were detected
Voir également
Browser
Depuis
1.5
Obsolète:
4.0 The (file, attribs, relative, pathOnly, detectBrowser, detectDebug) method signature is deprecated, use (file, options, attributes) instead.

Références $attribs, $document, $file, $options, Log\add(), Factory\getDocument(), et Log\WARNING.

◆ tooltip()

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

Creates a tooltip with an image as button

Paramètres
string$tooltipThe tip string.
mixed$titleThe 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.
string$imageThe image for the tip, if no text is provided.
string$textThe text for the tip.
string$hrefA URL that will be used to create the link.
string$altThe alt attribute for img tag.
string$classCSS class for the tool tip.
Renvoie
string
Depuis
1.5

Références $alt, $class, $href, $image, $param, $text, $title, $tooltip, ENT_COMPAT, htmlspecialchars, et null.

◆ tooltipText()

static tooltipText (   $title = '',
  $content = '',
  $translate = true,
  $escape = true 
)
static

Converts a double colon separated string or 2 separate strings to a string ready for bootstrap tooltips

Paramètres
string$titleThe title of the tooltip (or combined '::' separated string).
string$contentThe content to tooltip.
boolean$translateIf true will pass texts through JText.
boolean$escapeIf true will pass texts through htmlspecialchars.
Renvoie
string The tooltip string
Depuis
3.1.2

Références $content, $title, elseif, et htmlspecialchars.

◆ unregister()

static unregister (   $key)
static

Removes a key for a method from registry.

Paramètres
string$keyThe name of the key
Renvoie
boolean True if a set key is unset
Depuis
1.6

Références $key.

Documentation des champs

◆ $formatOptions

$formatOptions = array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t")
static

◆ $includePaths

$includePaths = array()
staticprotected

◆ $registry

$registry = array()
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :