JHtml
Utility class for all HTML drawing classes
Located in /libraries/joomla/html/html.php (line 26)
JHtml (Subpackage HTML)
static string
calendar
(string $value, string $name, string $id, [string $format = '%Y-%m-%d'], [array $attribs = null])
static string
date
([string $input = 'now'], [string $format = null], [mixed $tz = true], [boolean $gregorian = false])
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 mixed
script
(string $file, [boolean $framework = false], [boolean $relative = false], [boolean $path_only = false], [boolean $detect_browser = true], [boolean $detect_debug = true])
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'])
array
$formatOptions
= array('format.depth' => 0, 'format.eol' => "\n", 'format.indent' => "\t") (line 39)
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.
array
$includePaths
= array() (line 47)
An array to hold included paths
array
$registry
= array() (line 55)
An array to hold method references
Add a directory where JHtml should search for helpers. You may either pass a string or an array of directories.
- string $path: A path to search.
Displays a calendar control field
- 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
Function caller method
- string $function: Function or method to call
- array $args: Arguments to be passed to function
Returns formated date according to a given format and time zone.
- 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
Method to extract a 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.
Write a <iframe></iframe> element
- 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
Write a <img></img> element
- 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
Compute the files to be included
- 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
Test if the key is registered.
- string $key: The name of the key
Write a <a></a> element
- 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
Registers a function to be called with a specific key
- string $key: The name of the key
- string $function: Function or method
Write a <script></script> element
- 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
Set format related options.
Updates the formatOptions array with all valid values in the passed array. See {@see JHtml::$formatOptions} for details.
- array $options: Option key/value pairs.
Write a <link rel="stylesheet" style="text/css" /> element
- 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
Creates a tooltip with an image as button
- 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
Removes a key for a method from registry.
- string $key: The name of the 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
- 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.
JHtml (Subpackage HTML)
static