CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (GitHub)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • Slack
    • Paid Support
CakePHP

C CakePHP 1.2 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 1.2
      • 4.2
      • 4.1
      • 4.0
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Classes

  • AclBase
  • AclBehavior
  • AclComponent
  • AclNode
  • AclShell
  • Aco
  • AcoAction
  • AjaxHelper
  • ApcEngine
  • ApiShell
  • App
  • AppController
  • AppHelper
  • AppModel
  • Aro
  • AuthComponent
  • BakeShell
  • BehaviorCollection
  • Cache
  • CacheEngine
  • CacheHelper
  • CakeErrorController
  • CakeLog
  • CakeSchema
  • CakeSession
  • CakeSocket
  • ClassRegistry
  • Component
  • Configure
  • ConnectionManager
  • ConsoleShell
  • ContainableBehavior
  • Controller
  • ControllerTask
  • CookieComponent
  • DataSource
  • DbAcl
  • DbAclSchema
  • DbConfigTask
  • DboAdodb
  • DboDb2
  • DboFirebird
  • DboMssql
  • DboMysql
  • DboMysqlBase
  • DboMysqli
  • DboOdbc
  • DboOracle
  • DboPostgres
  • DboSource
  • DboSqlite
  • DboSybase
  • Debugger
  • EmailComponent
  • ErrorHandler
  • ExtractTask
  • File
  • FileEngine
  • Flay
  • Folder
  • FormHelper
  • Helper
  • HtmlHelper
  • HttpSocket
  • I18n
  • I18nModel
  • i18nSchema
  • I18nShell
  • Inflector
  • IniAcl
  • JavascriptHelper
  • JsHelper
  • JsHelperObject
  • L10n
  • MagicDb
  • MagicFileResource
  • MediaView
  • MemcacheEngine
  • Model
  • ModelBehavior
  • ModelTask
  • Multibyte
  • NumberHelper
  • Object
  • Overloadable
  • Overloadable2
  • PagesController
  • PaginatorHelper
  • Permission
  • PluginTask
  • ProjectTask
  • RequestHandlerComponent
  • Router
  • RssHelper
  • Sanitize
  • Scaffold
  • ScaffoldView
  • SchemaShell
  • Security
  • SecurityComponent
  • SessionComponent
  • SessionHelper
  • SessionsSchema
  • Set
  • Shell
  • String
  • TestSuiteShell
  • TestTask
  • TextHelper
  • ThemeView
  • TimeHelper
  • TranslateBehavior
  • TreeBehavior
  • Validation
  • View
  • ViewTask
  • XcacheEngine
  • Xml
  • XmlElement
  • XmlHelper
  • XmlManager
  • XmlNode
  • XmlTextNode

Functions

  • __enclose
  • make_clean_css
  • mb_encode_mimeheader
  • mb_stripos
  • mb_stristr
  • mb_strlen
  • mb_strpos
  • mb_strrchr
  • mb_strrichr
  • mb_strripos
  • mb_strrpos
  • mb_strstr
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count
  • write_css_cache

Class HtmlHelper

Html Helper class for easy use of HTML widgets.

HtmlHelper encloses all methods needed while working with HTML pages.

AppHelper
Extended by HtmlHelper
Package: cake\cake\libs\view\helpers
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: The MIT License
Location: view/helpers/html.php

Properties summary

  • $__docTypes public
    array
    Document type definitions
  • $_crumbs public
    array
    Breadcrumbs.
  • $action public
    string
    Current action.
  • $base public
    string
    Base URL
  • $data public
    array
    Enter description here...
  • $here public
    string
    URL to current action.
  • $params public
    array
    Parameter array.
  • $tags public
    array
    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
string
The nested list element
See
HtmlHelper::nestedList()

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
string
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
string
CSS or