Документация по Joomla 1.7

Joomla.Platform\JHtml
libraries/joomla/html/html.php at line 25

Class JHtml

JHtml

public abstract class JHtml

Utility class for all HTML drawing classes

Subpackage:
HTML
Since:
11.1

Field Summary
protected static array

$includePaths

An array to hold included paths

protected static array

$registry

An array to hold method references

Method Summary
protected static array

extract(string key)

Method to extract a key

static mixed

_(string key)

Class loader methodAdditional arguments may be supplied and are passed to the sub-class.

static boolean

register(string The, string Function, mixed key, mixed function)

Registers a function to be called with a specific key

static boolean

unregister(string The, mixed key)

Removes a key for a method from registry.

static boolean

isRegistered(string The, mixed key)

Test if the key is registered.

protected static mixed

call(string Function, array Arguments, mixed function, mixed args)

Function caller method

static string

link(string url, string text, array attribs)

Write a element

static string

iframe(string url, string name, array attribs, string noFrames)

Write a element

protected static array

_includeRelativeFiles(string file, boolean relative, boolean detect_browser, folder folder)

Compute the files to be include

static string

image(string file, string attribs, array relative, boolean path_only, mixed alt)

Write a element

static mixed

stylesheet(boolean path, array attributes, boolean return, boolean detect, mixed file, mixed attribs, bool path_only, bool detect_browser)

Write a element

static mixed

script(boolean path, boolean load, boolean return, boolean detect, mixed file, bool framework, bool relative, bool path_only, bool detect_browser)

Write a element

static void

core(boolean debug)

static void

setFormatOptions(array options)

Set format related options.

static string

date(string String, string Format, mixed Time, str input, mixed format, bool tz, bool gregorian)

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

static string

tooltip(string tooltip, mixed title, string image, string text, string href, string alt, str class)

Creates a tooltip with an image as button

static

calendar(string value, string name, string id, string format, array attribs)

Displays a calendar control field

static array

addIncludePath(string A, str path)

Add a directory where JHtml should search for helpers.

Field Detail

libraries/joomla/html/html.php at line 50

includePaths

protected static array $includePaths = array()

An array to hold included paths

Since:
11.1

libraries/joomla/html/html.php at line 58

registry

protected static array $registry = array()

An array to hold method references

Since:
11.1

Method Detail

libraries/joomla/html/html.php at line 70

extract

protected static array extract(string key)

Method to extract a key

Parameters:
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:
Contains lowercase key, prefix, file, function.
Since:
11.1

libraries/joomla/html/html.php at line 97

_

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 - 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:
JHtml::call($function, $args) or False on error
Since:
11.1

libraries/joomla/html/html.php at line 156

register

public static boolean register(string The, string Function, mixed key, mixed function)

Registers a function to be called with a specific key

Parameters:
The - name of the key
Function - or method
Returns:
True if the function is callable
Since:
11.1

libraries/joomla/html/html.php at line 175

unregister

public static boolean unregister(string The, mixed key)

Removes a key for a method from registry.

Parameters:
The - name of the key
Returns:
True if a set key is unset
Since:
11.1

libraries/joomla/html/html.php at line 194

isRegistered

public static boolean isRegistered(string The, mixed key)

Test if the key is registered.

Parameters:
The - name of the key
Returns:
True if the key is registered.
Since:
11.1

libraries/joomla/html/html.php at line 210

call

protected static mixed call(string Function, array Arguments, mixed function, mixed args)

Function caller method

Parameters:
Function - or method to call
Arguments - to be passed to function
Returns:
Function result or false on error.
Since:
11.1
See Also:
http://php.net/manual/en/function.call-user-func-array.php

libraries/joomla/html/html.php at line 237

link

public static string link(string url, string text, array attribs)

Write a element

Parameters:
url - The relative URL to use for the href attribute
text - The target attribute to use
attribs - An associative array of attributes to add
Returns:
string
Since:
11.1

libraries/joomla/html/html.php at line 257

iframe

public static string iframe(string url, string name, array attribs, string noFrames)

Write a element

Parameters:
url - The relative URL to use for the src attribute
name - The target attribute to use
attribs - An associative array of attributes to add
noFrames - The message to display if the iframe tag is not supported
Returns:
element or message if not supported
Since:
11.1

libraries/joomla/html/html.php at line 277

_includeRelativeFiles

protected static array _includeRelativeFiles(string file, boolean relative, boolean detect_browser, folder folder)

Compute the files to be include

Parameters:
file - path to file
relative - path to file is relative to /media folder
detect_browser - detect browser to include specific browser js files
folder - folder name to search into (images, css, js, ...)
See Also:
JBrowser
Returns:
files to be included
Since:
11.1

libraries/joomla/html/html.php at line 405

image

public static string image(string file, string attribs, array relative, boolean path_only, mixed alt)

Write a element

Parameters:
file - The relative or absolute URL to use for the src attribute
attribs - The target attribute to use
relative - An associative array of attributes to add
path_only - If set to true, it tries to find an override for the file in the template
Since:
11.1

libraries/joomla/html/html.php at line 465

stylesheet

public static mixed stylesheet(boolean path, array attributes, boolean return, boolean detect, mixed file, mixed attribs, bool path_only, bool detect_browser)

Write a element

Parameters:
path - to file
attributes - to be added to the stylesheet
path - to file is relative to /media folder
return - the path to the file only
detect - browser to include specific browser css files will try to include file, file_*browser*, file_*browser*_*major*, file_*browser*_*major*_*minor*
Navigator browser major.minor
Safari 3.0.x konqueror 522.x
Safari 3.1.x and 3.2.x konqueror 525.x
Safari 4.0 to 4.0.2 konqueror 530.x
Safari 4.0.3 to 4.0.4 konqueror 531.x
iOS 4.0 Safari konqueror 532.x
Safari 5.0 konqueror 533.x
Google Chrome 1.0 konqueror 528.x
Google Chrome 2.0 konqueror 530.x
Google Chrome 3.0 and 4.x konqueror 532.x
Google Chrome 5.0 konqueror 533.x
Internet Explorer 5.5 msie 5.5
Internet Explorer 6.x msie 6.x
Internet Explorer 7.x msie 7.x
Internet Explorer 8.x msie 8.x
Firefox mozilla 5.0
a lot of others
See Also:
JBrowser
Returns:
nothing if $path_only is false, null, path or array of path if specific css browser files were detected
Since:
11.1

libraries/joomla/html/html.php at line 516

script

public static mixed script(boolean path, boolean load, boolean return, boolean detect, mixed file, bool framework, bool relative, bool path_only, bool detect_browser)

Write a element

Parameters:
path - to file
load - the JS framework
path - to file is relative to /media folder
return - the path to the file only
detect - browser to include specific browser js files
Returns:
nothing if $path_only is false, null, path or array of path if specific js browser files were detected
See Also:
JHtml::stylesheet
Since:
11.1

libraries/joomla/html/html.php at line 564

core

public static void core(boolean debug)

Parameters:
debug - True if debugging is enabled.
Since:
11.1

libraries/joomla/html/html.php at line 588

setFormatOptions

public static void setFormatOptions(array options)

Set format related options.

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

Parameters:
options - Option key/value pairs.
Since:
11.1

libraries/joomla/html/html.php at line 609

date

public static string date(string String, string Format, mixed Time, str input, mixed format, bool tz, bool gregorian)

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

Parameters:
String - in a format accepted by date(), defaults to "now".
Format - optional format for strftime
Time - zone to be used for the date. Special cases: boolean true for user setting, boolean false for server setting.
Returns:
A date translated by the given format and time zone.
See Also:
strftime
Since:
11.1

libraries/joomla/html/html.php at line 675

tooltip

public static string tooltip(string tooltip, mixed title, string image, string text, string href, string alt, str class)

Creates a tooltip with an image as button

Parameters:
tooltip - The tip string
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 - The image for the tip, if no text is provided
text - The text for the tip
href - An URL that will be used to create the link
alt - The alt attribute for img tag
Since:
11.1

libraries/joomla/html/html.php at line 735

calendar

public static calendar(string value, string name, string id, string format, array attribs)

Displays a calendar control field

Parameters:
value - The date value
name - The name of the text field
id - The id of the text field
format - The date format
attribs - Additional HTML attributes
Since:
11.1

libraries/joomla/html/html.php at line 787

addIncludePath

public static array addIncludePath(string A, str path)

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

Parameters:
A - path to search.
Returns:
An array with directory elements
Since:
11.1

Документация по Joomla 1.7