Class HtmlHelper
Html Helper class for easy use of HTML widgets.
HtmlHelper encloses all methods needed while working with HTML pages.
- AppHelper
-
HtmlHelper
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: The MIT License
Location: view/helpers/html.php
Properties summary
-
$__docTypes
publicarray
Document type definitions -
$_crumbs
publicarray
Breadcrumbs. -
$action
publicstring
Current action. -
$base
publicstring
Base URL -
$data
publicarray
Enter description here... -
$here
publicstring
URL to current action. -
$params
publicarray
Parameter array. -
$tags
publicarray
html tags used by this helper.
Method Summary
-
__nestedListItem() public
Internal function to build a nested list (UL/OL) out of an associative array. -
addCrumb() public
Adds a link to the breadcrumbs array. -
charset() public
Returns a charset META-tag. -
css() public
Creates a link element for CSS stylesheets. -
div() public
Returns a formatted DIV tag for HTML FORMs. -
docType() public
Returns a doctype string. -
getCrumbs() public
Returns the breadcrumb trail as a sequence of »-separated links. -
image() public
Creates a formatted IMG element. -
link() public
Creates an HTML link. -
meta() public
Creates a link to an external resource and handles basic meta tags -
nestedList() public
Build a nested list (UL/OL) out of an associative array. -
para() public
Returns a formatted P tag. -
style() public
Builds CSS style data from an array of CSS properties -
tableCells() public
Returns a formatted string of table rows (TR's with TD's in them). -
tableHeaders() public
Returns a row of formatted and named TABLE headers. -
tag() public
Returns a formatted block tag, i.e DIV, SPAN, P.
Method Detail
__nestedListItem() public ¶
__nestedListItem( array $items , array $attributes , array $itemAttributes , string $tag )
Internal function to build a nested list (UL/OL) out of an associative array.
Parameters
- array $items
- $list Set of elements to list
- array $attributes
- Additional HTML attributes of the list (ol/ul) tag
- array $itemAttributes
- Additional HTML attributes of the list item (LI) tag
- string $tag
- Type of list tag to use (ol/ul)
Returns
The nested list element
See
addCrumb() public ¶
addCrumb( string $name , string $link = null , mixed $options = null )
Adds a link to the breadcrumbs array.
Parameters
- string $name
- Text for link
- string $link optional null
- URL for link (if empty it won't be a link)
- mixed $options optional null
- Link attributes e.g. array('id'=>'selected')
charset() public ¶
charset( string $charset = null )
Returns a charset META-tag.
Parameters
- string $charset optional null
- The character set to be used in the meta tag. Example: "utf-8".
Returns
A meta tag containing the specified character set.
css() public ¶
css( mixed $path , string $rel = null , array $htmlAttributes = array() , boolean $inline = true )
Creates a link element for CSS stylesheets.
Parameters
- mixed $path
The name of a CSS style sheet or an array containing names of CSS stylesheets. If
$path
is prefixed with '/', the path will be relative to the webroot of your application. Otherwise, the path will be relative to your CSS path, usually webroot/css.- string $rel optional null
- Rel attribute. Defaults to "stylesheet". If equal to 'import' the stylesheet will be imported.
- array $htmlAttributes optional array()
- Array of HTML attributes.
- boolean $inline optional true
- If set to false, the generated tag appears in the head tag of the layout.
Returns
CSS or