HtmlHelper Class Reference

Public Member Functions | |
| addCrumb ($name, $link=null, $options=null) | |
| charset ($charset=null) | |
| css ($path, $rel=null, $htmlAttributes=array(), $inline=true) | |
| div ($class=null, $text=null, $attributes=array(), $escape=false) | |
| docType ($type= 'xhtml-strict') | |
| getCrumbs ($separator= '»', $startText=false) | |
| image ($path, $options=array()) | |
| link ($title, $url=null, $htmlAttributes=array(), $confirmMessage=false, $escapeTitle=true) | |
| meta ($type, $url=null, $attributes=array(), $inline=true) | |
| nestedList ($list, $attributes=array(), $itemAttributes=array(), $tag= 'ul') | |
| para ($class, $text, $attributes=array(), $escape=false) | |
| style ($data, $inline=true) | |
| tableCells ($data, $oddTrOptions=null, $evenTrOptions=null, $useCount=false, $continueOddEven=true) | |
| tableHeaders ($names, $trOptions=null, $thOptions=null) | |
| tag ($name, $text=null, $attributes=array(), $escape=false) | |
Public Attributes | |
| $_crumbs = array() | |
| $action = null | |
| $base = null | |
| $data = null | |
| $here = null | |
| $params = array() | |
| $tags | |
Detailed Description
Definition at line 35 of file html.php.
Member Function Documentation
| HtmlHelper::addCrumb | ( | $ | name, | |
| $ | link = null, |
|||
| $ | options = null | |||
| ) |
| HtmlHelper::charset | ( | $ | charset = null |
) |
Returns a charset META-tag.
- Parameters:
-
string $charset The character set to be used in the meta tag. Example: "utf-8".
- Returns:
- string A meta tag containing the specified character set.
Definition at line 259 of file html.php.
References Helper::output(), and Configure::read().
| HtmlHelper::css | ( | $ | path, | |
| $ | rel = null, |
|||
| $ | htmlAttributes = array(), |
|||
| $ | inline = true | |||
| ) |
Creates a link element for CSS stylesheets.
- Parameters:
-
mixed $path The name of a CSS style sheet in /app/webroot/css, or an array containing names of CSS stylesheets in that directory. string $rel Rel attribute. Defaults to "stylesheet". array $htmlAttributes Array of HTML attributes. boolean $inline If set to false, the generated tag appears in the head tag of the layout.
- Returns:
- string CSS <link> or <style> tag, depending on the type of link.
| HtmlHelper::div | ( | $ | class = null, |
|
| $ | text = null, |
|||
| $ | attributes = array(), |
|||
| $ | escape = false | |||
| ) |
Returns a formatted DIV tag for HTML FORMs.
- Parameters:
-
string $class CSS class name of the div element. string $text String content that will appear inside the div element. If null, only a start tag will be printed array $attributes Additional HTML attributes of the DIV tag boolean $escape If true, $text will be HTML-escaped
- Returns:
- string The formatted DIV element
| HtmlHelper::docType | ( | $ | type = 'xhtml-strict' |
) |
Returns a doctype string.
Possible doctypes: + html4-strict: HTML4 Strict. + html4-trans: HTML4 Transitional. + html4-frame: HTML4 Frameset. + xhtml-strict: XHTML1 Strict. + xhtml-trans: XHTML1 Transitional. + xhtml-frame: XHTML1 Frameset. + xhtml11: XHTML1.1.
- Parameters:
-
string $type Doctype to use.
- Returns:
- string Doctype.
Definition at line 185 of file html.php.
References Helper::output().
| HtmlHelper::getCrumbs | ( | $ | separator = '»', |
|
| $ | startText = false | |||
| ) |
| HtmlHelper::image | ( | $ | path, | |
| $ | options = array() | |||
| ) |
| HtmlHelper::link | ( | $ | title, | |
| $ | url = null, |
|||
| $ | htmlAttributes = array(), |
|||
| $ | confirmMessage = false, |
|||
| $ | escapeTitle = true | |||
| ) |
Creates an HTML link.
If $url starts with "http://" this is treated as an external link. Else, it is treated as a path to controller/action and parsed with the HtmlHelper::url() method.
If the $url is empty, $title is used instead.
- Parameters:
-
string $title The content to be wrapped by tags. mixed $url Cake-relative URL or array of URL parameters, or external URL (starts with http://) array $htmlAttributes Array of HTML attributes. string $confirmMessage JavaScript confirmation message. boolean $escapeTitle Whether or not $title should be HTML escaped.
- Returns:
- string An element.
Definition at line 279 of file html.php.
References $url, Helper::_parseAttributes(), Helper::output(), and Helper::url().
Referenced by meta().
| HtmlHelper::meta | ( | $ | type, | |
| $ | url = null, |
|||
| $ | attributes = array(), |
|||
| $ | inline = true | |||
| ) |
Creates a link to an external resource and handles basic meta tags
- Parameters:
-
string $title The title of the external resource mixed $url The address of the external resource or string for content attribute array $attributes Other attributes for the generated tag. If the type attribute is html, rss, atom, or icon, the mime-type is returned. boolean $inline If set to false, the generated tag appears in the head tag of the layout.
- Returns:
- string
Definition at line 200 of file html.php.
References $out, $url, Helper::_parseAttributes(), ClassRegistry::getObject(), image(), link(), Helper::output(), Helper::url(), and Helper::webroot().
| HtmlHelper::nestedList | ( | $ | list, | |
| $ | attributes = array(), |
|||
| $ | itemAttributes = array(), |
|||
| $ | tag = 'ul' | |||
| ) |
Build a nested list (UL/OL) out of an associative array.
- Parameters:
-
array $list Set of elements to list array $attributes Additional HTML attributes of the list (ol/ul) tag or if ul/ol use that as tag array $itemAttributes Additional HTML attributes of the list item (LI) tag string $tag Type of list tag to use (ol/ul)
- Returns:
- string The nested list public
| HtmlHelper::para | ( | $ | class, | |
| $ | text, | |||
| $ | attributes = array(), |
|||
| $ | escape = false | |||
| ) |
Returns a formatted P tag.
- Parameters:
-
string $class CSS class name of the p element. string $text String content that will appear inside the p element. array $attributes Additional HTML attributes of the P tag boolean $escape If true, $text will be HTML-escaped
- Returns:
- string The formatted P element
| HtmlHelper::style | ( | $ | data, | |
| $ | inline = true | |||
| ) |
| HtmlHelper::tableCells | ( | $ | data, | |
| $ | oddTrOptions = null, |
|||
| $ | evenTrOptions = null, |
|||
| $ | useCount = false, |
|||
| $ | continueOddEven = true | |||
| ) |
Returns a formatted string of table rows (TR's with TD's in them).
- Parameters:
-
array $data Array of table data array $oddTrOptions HTML options for odd TR elements if true useCount is used array $evenTrOptions HTML options for even TR elements bool $useCount adds class "column-$i" bool $continueOddEven If false, will use a non-static $count variable, so that the odd/even count is reset to zero just for that call
- Returns:
- string Formatted HTML
Definition at line 486 of file html.php.
References $out.
| HtmlHelper::tableHeaders | ( | $ | names, | |
| $ | trOptions = null, |
|||
| $ | thOptions = null | |||
| ) |
| HtmlHelper::tag | ( | $ | name, | |
| $ | text = null, |
|||
| $ | attributes = array(), |
|||
| $ | escape = false | |||
| ) |
Returns a formatted block tag, i.e DIV, SPAN, P.
- Parameters:
-
string $name Tag name. string $text String content that will appear inside the div element. If null, only a start tag will be printed array $attributes Additional HTML attributes of the DIV tag boolean $escape If true, $text will be HTML-escaped
- Returns:
- string The formatted tag element
Member Data Documentation
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/view/helpers/html.php