Class JHtml

Description

Utility class for all HTML drawing classes

  • abstract:
  • since: 11.1

Located in /libraries/joomla/html/html.php (line 25)


	
			
Variable Summary
static array $formatOptions
static array $includePaths
static array $registry
Method Summary
static array addIncludePath ([string $path = ''])
static string calendar (string $value, string $name, string $id, [string $format = '%Y-%m-%d'], [array $attribs = null])
static mixed call (string $function, array $args)
static void core ([boolean $debug = null])
static string date ([string $input = 'now'], [string $format = null], [mixed $tz = true], [boolean $gregorian = false])
static array extract (string $key)
static string iframe (string $url, string $name, [array $attribs = null], [string $noFrames = ''])
static string image (string $file, string $alt, [string $attribs = null], [array $relative = false], [boolean $path_only = false])
static array includeRelativeFiles (string $folder, string $file, boolean $relative, boolean $detect_browser, boolean $detect_debug)
static boolean isRegistered (string $key)
static string link (string $url, string $text, [array $attribs = null])
static boolean register (string $key, string $function)
static mixed script (string $file, [boolean $framework = false], [boolean $relative = false], [boolean $path_only = false], [boolean $detect_browser = true], [boolean $detect_debug = true])
static void setFormatOptions (array $options)
static mixed stylesheet (string $file, [array $attribs = array()], [boolean $relative = false], [boolean $path_only = false], [boolean $detect_browser = true], [boolean $detect_debug = true])
static string tooltip (string $tooltip, [mixed $title = ''], [string $image = 'tooltip.png'], [string $text = ''], [string $href = ''], [string $alt = 'Tooltip'], [string $class = 'hasTip'])
static boolean unregister (string $key)
static mixed _ (string $key)
static array _includeRelativeFiles (string $file, boolean $relative, boolean $detect_browser, string $folder)
Variables
static array $formatOptions = array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t") (line 38)

Option values related to the generation of HTML output. Recognized options are: fmtDepth, integer. The current indent depth.

fmtEol, string. The end of line string, default is linefeed. fmtIndent, string. The string to use for indentation, default is tab.

  • since: 11.1
  • access: public
static array $includePaths = array() (line 46)

An array to hold included paths

  • since: 11.1
  • access: protected
static array $registry = array() (line 54)

An array to hold method references

  • since: 11.1
  • access: protected
Methods
static method addIncludePath (line 916)

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

  • return: An array with directory elements
  • since: 11.1
  • access: public
static array addIncludePath ([string $path = ''])
  • string $path: A path to search.
static method calendar (line 851)

Displays a calendar control field

  • return: HTML markup for a calendar field
  • since: 11.1
  • access: public
static string calendar (string $value, string $name, string $id, [string $format = '%Y-%m-%d'], [array $attribs = null])
  • 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
static method call (line 212)

Function caller method

static mixed call (string $function, array $args)
  • string $function: Function or method to call
  • array $args: Arguments to be passed to function
static method core (line 659)

Add the /media/system/js/core Javascript file.

  • deprecated: 12.1 Use JHtml::_('behavior.framework'); instead.
  • since: 11.1
  • access: public
static void core ([boolean $debug = null])
  • boolean $debug: True if debugging is enabled.
static method date (line 702)

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

  • return: A date translated by the given format and time zone.
  • see: strftime
  • since: 11.1
  • access: public
static string date ([string $input = 'now'], [string $format = null], [mixed $tz = true], [boolean $gregorian = false])
  • string $input: String in a format accepted by date(), defaults to "now".
  • string $format: Format optional format for strftime
  • mixed $tz: Time zone to be used for the date. Special cases: boolean true for user setting, boolean false for server setting.
  • boolean $gregorian: True to use Gregorian calenar
static method extract (line 66)

Method to extract a key

  • return: Contains lowercase key, prefix, file, function.
  • since: 11.1
  • access: protected
static array extract (string $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.
static method iframe (line 264)

Write a <iframe></iframe> element

  • return: <iframe></iframe> element or message if not supported
  • since: 11.1
  • access: public
static string iframe (string $url, string $name, [array $attribs = null], [string $noFrames = ''])
  • 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
static method image (line 474)

Write a <img></img> element

  • since: 11.1
  • access: public
static string image (string $file, string $alt, [string $attribs = null], [array $relative = false], [boolean $path_only = false])
  • string $file: The relative or absolute URL to use for the src attribute
  • string $alt: The alt text.
  • string $attribs: The target attribute to use
  • array $relative: An associative array of attributes to add
  • boolean $path_only: If set to true, it tries to find an override for the file in the template
static method includeRelativeFiles (line 310)

Compute the files to be include

  • return: files to be included
  • see: JBrowser
  • since: 11.1
  • access: protected
static array includeRelativeFiles (string $folder, string $file, boolean $relative, boolean $detect_browser, boolean $detect_debug)
  • string $folder: folder name to search into (images, css, js, ...)
  • string $file: path to file
  • boolean $relative: path to file is relative to /media folder
  • boolean $detect_browser: detect browser to include specific browser files
  • boolean $detect_debug: detect debug to include compressed files if debug is on
static method isRegistered (line 195)

Test if the key is registered.

  • return: True if the key is registered.
  • since: 11.1
  • access: public
static boolean isRegistered (string $key)
  • string $key: The name of the key
static method link (line 242)

Write a <a></a> element

  • return: <a></a> string
  • since: 11.1
  • access: public
static string link (string $url, string $text, [array $attribs = null])
  • 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
static method register (line 154)

Registers a function to be called with a specific key

  • return: True if the function is callable
  • since: 11.1
  • access: public
static boolean register (string $key, string $function)
  • string $key: The name of the key
  • string $function: Function or method
static method script (line 602)

Write a <script></script> element

  • return: nothing if $path_only is false, null, path or array of path if specific js browser files were detected
  • see: JHtml::stylesheet
  • since: 11.1
  • access: public
static mixed script (string $file, [boolean $framework = false], [boolean $relative = false], [boolean $path_only = false], [boolean $detect_browser = true], [boolean $detect_debug = true])
  • 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
  • boolean $detect_debug: detect debug to search for compressed files if debug is on
static method setFormatOptions (line 677)

Set format related options.

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

  • since: 11.1
  • access: public
static void setFormatOptions (array $options)
  • array $options: Option key/value pairs.
static method stylesheet (line 540)

Write a <link rel="stylesheet" style="text/css" /> element

  • return: nothing if $path_only is false, null, path or array of path if specific css browser files were detected
  • see: JBrowser
  • since: 11.1
  • access: public
static mixed stylesheet (string $file, [array $attribs = array()], [boolean $relative = false], [boolean $path_only = false], [boolean $detect_browser = true], [boolean $detect_debug = true])
  • 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, file_*browser*, file_*browser*_*major*, file_*browser*_*major*_*minor* <table> <tr><th>Navigator</th> <th>browser</th> <th>major.minor</th></tr>

    <tr><td>Safari 3.0.x</td> <td>konqueror</td> <td>522.x</td></tr> <tr><td>Safari 3.1.x and 3.2.x</td> <td>konqueror</td> <td>525.x</td></tr> <tr><td>Safari 4.0 to 4.0.2</td> <td>konqueror</td> <td>530.x</td></tr> <tr><td>Safari 4.0.3 to 4.0.4</td> <td>konqueror</td> <td>531.x</td></tr> <tr><td>iOS 4.0 Safari</td> <td>konqueror</td> <td>532.x</td></tr> <tr><td>Safari 5.0</td> <td>konqueror</td> <td>533.x</td></tr>

    <tr><td>Google Chrome 1.0</td> <td>konqueror</td> <td>528.x</td></tr> <tr><td>Google Chrome 2.0</td> <td>konqueror</td> <td>530.x</td></tr> <tr><td>Google Chrome 3.0 and 4.x</td> <td>konqueror</td> <td>532.x</td></tr> <tr><td>Google Chrome 5.0</td> <td>konqueror</td> <td>533.x</td></tr>

    <tr><td>Internet Explorer 5.5</td> <td>msie</td> <td>5.5</td></tr> <tr><td>Internet Explorer 6.x</td> <td>msie</td> <td>6.x</td></tr> <tr><td>Internet Explorer 7.x</td> <td>msie</td> <td>7.x</td></tr> <tr><td>Internet Explorer 8.x</td> <td>msie</td> <td>8.x</td></tr>

    <tr><td>Firefox</td> <td>mozilla</td> <td>5.0</td></tr> </table> a lot of others

  • boolean $detect_debug: detect debug to search for compressed files if debug is on
static method tooltip (line 778)

Creates a tooltip with an image as button

  • since: 11.1
  • access: public
static string tooltip (string $tooltip, [mixed $title = ''], [string $image = 'tooltip.png'], [string $text = ''], [string $href = ''], [string $alt = 'Tooltip'], [string $class = 'hasTip'])
  • string $tooltip: The tip string
  • 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.
  • string $image: The image for the tip, if no text is provided
  • string $text: The text for the tip
  • string $href: An URL that will be used to create the link
  • string $alt: The alt attribute for img tag
  • string $class: CSS class for the tool tip
static method unregister (line 174)

Removes a key for a method from registry.

  • return: True if a set key is unset
  • since: 11.1
  • access: public
static boolean unregister (string $key)
  • string $key: The name of the key
static method _ (line 94)

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

  • return: JHtml::call($function, $args) or False on error
  • since: 11.1
  • access: public
static mixed _ (string $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.
static method _includeRelativeFiles (line 289)

Compute the files to be include

  • return: files to be included
  • see: JBrowser
  • deprecated: 12.1
  • since: 11.1
  • access: protected
static array _includeRelativeFiles (string $file, boolean $relative, boolean $detect_browser, string $folder)
  • string $file: path to file
  • boolean $relative: path to file is relative to /media folder
  • boolean $detect_browser: detect browser to include specific browser files
  • string $folder: folder name to search into (images, css, js, ...)

Documentation generated on Mon, 25 Jun 2012 13:55:37 -0500 by phpDocumentor 1.4.4