Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe HTMLHelper

Fonctions membres publiques statiques

static _ (string $key,... $methodArgs)
 
static register ($key, callable $function)
 
static unregister ($key)
 
static isRegistered ($key)
 
static getServiceRegistry ()
 
static link ($url, $text, $attribs=null)
 
static iframe ($url, $name, $attribs=null, $noFrames='')
 
static cleanImageURL ($url)
 
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='')
 

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 (callable $function, $args)
 
static includeRelativeFiles ($folder, $file, $relative, $detectBrowser, $detectDebug)
 
static addFileToBuffer ($path='', $ext='', $debugMode=false)
 
static convertToRelativePath ($path)
 

Attributs protégés statiques

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

Fonctions membres privées statiques

static checkFileOrder ($first, $second)
 

Description détaillée

Utility class for all HTML drawing classes

Depuis
1.5

Documentation des fonctions membres

◆ _()

static _ ( string  $key,
  $methodArgs 
)
staticfinal

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.
array$methodArgsThe arguments to pass forward to the method being called
Renvoie
mixed Result of HTMLHelper::call($function, $args)
Depuis
1.5
Exceptions

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

Référencé par LinkModel\activate(), FormBehavior\ajaxchosen(), Tag\ajaxfield(), Access\assetgrouplist(), Modules\batchOptions(), Select\booleanlist(), Icons\buttons(), Category\categories(), Banner\clients(), Languages\clients(), Icon\create(), FeedView\display(), DisplayController\display(), HtmlView\display(), Icon\edit(), WorkflowStage\existing(), ListHelper\genericordering(), UsersHelper\getActiveOptions(), ModulesModel\getActivePositions(), ModulesHelper\getAssignmentOptions(), TemplatesHelper\getClientOptions(), ModulesHelper\getClientOptions(), InstallerHelper\getClientOptions(), BannersHelper\getClientOptions(), MessagesModel\getComponentOptions(), InstallerHelper\getExtensionGroups(), InstallerHelper\getExtensionTypes(), ItemtypeField\getGroups(), GroupedlistField\getGroups(), WorkflowstageField\getGroups(), TimezoneField\getGroups(), TemplatestyleField\getGroups(), ChromestyleField\getGroups(), MenuitemField\getGroups(), MenuItemByTypeField\getGroups(), PlugininfoField\getInput(), AssociationField\getInput(), FieldLayoutField\getInput(), MenutypeField\getInput(), ModulelayoutField\getInput(), ComponentlayoutField\getInput(), UploaddirsField\getInput(), TemplatesListField\getInput(), OrderingField\getInput(), ModulesPositioneditField\getInput(), ModulepositionField\getInput(), ConsentBoxField\getInput(), Authentication\getKnownAuthenticators(), TosField\getLabel(), SpacerField\getLabel(), NoteField\getLabel(), ConsentBoxField\getLabel(), LoginHelper\getLanguageList(), DebugHelper\getLevelsOptions(), Pagination\getLimitBox(), StatsHelper\getList(), ArticlesArchiveHelper\getList(), ArticlesCategoryHelper\getList(), Utility\getMaxUploadSize(), ModuletagField\getOptions(), HeadertagField\getOptions(), IntegerField\getOptions(), ContentlanguageField\getOptions(), AccesslevelField\getOptions(), BranchesField\getOptions(), WorkflowComponentSectionsField\getOptions(), SearchfilterField\getOptions(), SessionhandlerField\getOptions(), CachehandlerField\getOptions(), ExtensionField\getOptions(), FontsField\getOptions(), LogtypeField\getOptions(), MenuPresetField\getOptions(), TaskTypeField\getOptions(), ContenttypesField\getOptions(), CategoryField\getOptions(), TypeField\getOptions(), SubfieldsField\getOptions(), TransitionField\getOptions(), RedirectField\getOptions(), CategoryeditField\getOptions(), CronField\getOptions(), FolderlistField\getOptions(), FilelistField\getOptions(), TextField\getOptions(), SqlField\getOptions(), LocalAdapter\getPathInformation(), ModulesHelper\getPositions(), DisplayController\getQuickiconContent(), UsersHelper\getRangeOptions(), MessagesHelper\getStateOptions(), ModulesHelper\getStateOptions(), UsersHelper\getStateOptions(), InstallerHelper\getStateOptions(), User\groups(), ListHelper\images(), Dropdown\init(), Select\integerlist(), Access\level(), Menu\linkOptions(), Links\links(), Links\linksgroups(), MediaActionPlugin\loadCss(), MediaActionPlugin\loadJs(), Finder\mapslist(), Menu\menuItemList(), Menu\menuItems(), Users\notesModal(), CoreAssetItem\onAttachCallback(), Joomla\Plugin\Editors\TinyMCE\PluginTraits\onDisplay(), Category\options(), Tag\options(), Pagination\orderDownIcon(), ListHelper\ordering(), Menu\ordering(), Pagination\orderUpIcon(), Banner\pinned(), Modules\positions(), ListHelper\positions(), ContentmapField\prepareLevel(), Languages\published(), PluginsHelper\publishedOptions(), RedirectHelper\publishedOptions(), Languages\publishedOptions(), FeedView\reconcileNames(), Date\relative(), PublishedButton\render(), FeaturedButton\render(), PopupButton\renderButton(), Bootstrap\renderModal(), WebAssetItem\resolvePath(), Text\script(), Filter\select(), ActionlogModel\sendNotificationEmails(), BreadcrumbsHelper\setSeparator(), Filter\slider(), Grid\sort(), SortableList\sortable(), Bootstrap\startTabSet(), Updatesites\state(), Manage\state(), Modules\state(), Finder\statelist(), Tag\tags(), Modules\templates(), Modules\templateStates(), Templates\thumb(), Templates\thumbModal(), Jquery\token(), ArticlesCategoryHelper\truncate(), StringHelper\truncateComplex(), Modules\types(), Finder\typeslist(), Access\usergroup(), ListHelper\users(), et Debug\xdebuglink().

◆ addFileToBuffer()

static addFileToBuffer (   $path = '',
  $ext = '',
  $debugMode = false 
)
staticprotected

Method that searches if file exists in given path and returns the relative path. If a minified version exists it will be preferred.

Paramètres
string$pathThe actual path of the file
string$extThe extension of the file
boolean$debugModeSignifies if debug is enabled
Renvoie
string The relative path of the file
Depuis
4.0.0

Références $path, et $position.

◆ 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
Obsolète:
5.0 Use the service registry instead

Références $dir, $path, et Path\clean().

◆ 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 $app, $attribs, $autocomplete, $autofocus, $class, $data, $direction, $disabled, $format, $hint, $id, $inputvalue, $lang, $name, $onchange, $readonly, $required, $value, Factory\getApplication(), Factory\getDbo(), JPATH_ROOT, null, et LayoutHelper\render().

◆ call()

static call ( callable  $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, et $temp.

◆ checkFileOrder()

static checkFileOrder (   $first,
  $second 
)
staticprivate

Method that takes two paths and checks if the files exist with different order

Paramètres
string$firstthe path of the minified file
string$secondthe path of the non minified file
Renvoie
string
Depuis
4.0.0

◆ cleanImageURL()

static cleanImageURL (   $url)
static

Références $height, $url, $width, et null.

◆ convertToRelativePath()

static convertToRelativePath (   $path)
staticprotected

Method that takes a file path and converts it to a relative path

Paramètres
string$pathThe actual path of the file
Renvoie
string The relative path of the file
Depuis
4.0.0

Références $path, JPATH_ROOT, et Uri\root().

◆ 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 $app, $date, $format, $input, Text\_(), elseif, Factory\getApplication(), Factory\getDate(), Factory\getLanguage(), 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
Obsolète:
5.0 Use the service registry instead

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

◆ getServiceRegistry()

static getServiceRegistry ( )
static

Retrieves the service registry.

Renvoie
Registry
Depuis
4.0.0

Références class, et Factory\getContainer().

◆ 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, $attributes, $key, $path, $value, Joomla\Plugin\Editors\TinyMCE\PluginTraits\includeRelativeFiles(), null, et LayoutHelper\render().

◆ 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
Browser
Depuis
1.6

Loop on 1 or 2 files and break on first found. Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh This MD5SUM file must represent the signature of the folder content

Loop on 1 or 2 files and break on first found. Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh This MD5SUM file must represent the signature of the folder content

Références $app, $client, $extension, $path, $template, Factory\getApplication(), File\getExt(), Browser\getInstance(), JDEBUG, JPATH_ROOT, JPATH_THEMES, et File\stripExt().

◆ 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().

Référencé par ActionsDropdown\addCustomItem().

◆ register()

static register (   $key,
callable  $function 
)
static

Registers a function to be called with a specific key

Paramètres
string$keyThe name of the key
callable$functionFunction or method
Renvoie
boolean True if the function is callable
Depuis
1.6
Obsolète:
5.0 Use the service registry instead

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

Références $attribs, $document, $options, Factory\getApplication(), et Joomla\Plugin\Editors\TinyMCE\PluginTraits\includeRelativeFiles().

◆ 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, $options, et $val.

◆ 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

Références $attribs, $document, $options, Factory\getApplication(), et Joomla\Plugin\Editors\TinyMCE\PluginTraits\includeRelativeFiles().

◆ 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, $text, $title, $tooltip, ENT_COMPAT, image, 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 Text.
boolean$escapeIf true will pass texts through htmlspecialchars.
Renvoie
string The tooltip string
Depuis
3.1.2

Références $content, $result, $title, Text\_(), et elseif.

◆ 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
Obsolète:
5.0 Use the service registry instead

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

◆ $serviceRegistry

$serviceRegistry
staticprotected

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