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.3 API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 1.3
      • 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
  • BakeTask
  • BehaviorCollection
  • Cache
  • CacheEngine
  • CacheHelper
  • CakeErrorController
  • CakeLog
  • CakeRoute
  • CakeSchema
  • CakeSession
  • CakeSocket
  • ClassRegistry
  • Component
  • Configure
  • ConnectionManager
  • ConsoleShell
  • ContainableBehavior
  • Controller
  • ControllerTask
  • CookieComponent
  • DataSource
  • DbAcl
  • DbConfigTask
  • DboMssql
  • DboMysql
  • DboMysqlBase
  • DboMysqli
  • DboOracle
  • DboPostgres
  • DboSource
  • DboSqlite
  • Debugger
  • EmailComponent
  • ErrorHandler
  • ExtractTask
  • File
  • FileEngine
  • FileLog
  • FixtureTask
  • Folder
  • FormHelper
  • Helper
  • HtmlHelper
  • HttpSocket
  • I18n
  • I18nModel
  • I18nShell
  • Inflector
  • IniAcl
  • JavascriptHelper
  • JqueryEngineHelper
  • JsBaseEngineHelper
  • JsHelper
  • L10n
  • MagicDb
  • MagicFileResource
  • MediaView
  • MemcacheEngine
  • Model
  • ModelBehavior
  • ModelTask
  • MootoolsEngineHelper
  • Multibyte
  • NumberHelper
  • Object
  • Overloadable
  • Overloadable2
  • PagesController
  • PaginatorHelper
  • Permission
  • PluginShortRoute
  • PluginTask
  • ProjectTask
  • PrototypeEngineHelper
  • RequestHandlerComponent
  • Router
  • RssHelper
  • Sanitize
  • Scaffold
  • ScaffoldView
  • SchemaShell
  • Security
  • SecurityComponent
  • SessionComponent
  • SessionHelper
  • Set
  • Shell
  • String
  • TemplateTask
  • TestSuiteShell
  • TestTask
  • TextHelper
  • ThemeView
  • TimeHelper
  • TranslateBehavior
  • TreeBehavior
  • Validation
  • View
  • ViewTask
  • XcacheEngine
  • Xml
  • XmlElement
  • XmlHelper
  • XmlManager
  • XmlNode
  • XmlTextNode

Functions

  • 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

Class HtmlHelper

Html Helper class for easy use of HTML widgets.

HtmlHelper encloses all methods needed while working with HTML pages.

Object
Extended by Overloadable
Extended by Helper
Extended by AppHelper
Extended by HtmlHelper
Package: cake\cake\libs\view\helpers
Link: http://book.cakephp.org/1.3/en/The-Manual/Core-Helpers/HTML.html#HTML
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: view/helpers/html.php

Properties summary

  • $__docTypes public
    array
    Document type definitions
  • $__includedScripts public
    array
    Names of script files that have been included once
  • $_crumbs public
    array
    Breadcrumbs.
  • $_scriptBlockOptions public
    array
    Options for the currently opened script block buffer if any.
  • $tags public
    array
    html tags used by this helper.

Inherited Properties

  • __cleaned, __tainted, action, argSeparator, base, data, helpers, here, namedArgs, params, plugin, theme, validationErrors, webroot

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. If $options['url'] is provided, an image link will be generated with the link pointed at $options['url']. This method will set an empty alt attribute if one is not supplied.

  • 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.
  • script() public
    Returns one or many <script> tags depending on the number of scripts given.
  • scriptBlock() public
    Wrap $script in a script tag.
  • scriptEnd() public

    End a Buffered section of Javascript capturing. Generates a script tag inline or in $scripts_for_layout depending on the settings used when the scriptBlock was started

  • scriptStart() public

    Begin a script block that captures output until HtmlHelper::scriptEnd() is called. This capturing block will capture all output between the methods and create a scriptBlock from it.

  • 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 $options , array $itemOptions , string $tag )

Internal function to build a nested list (UL/OL) out of an associative array.

Parameters
array $items
Set of elements to list
array $options
Additional HTML attributes of the list (ol/ul) tag
array $itemOptions
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')
See
HtmlHelper::link() for details on $options that can be used.

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. If empty, The App.encoding value will be used. Example: "utf-8".

Returns
string
A meta tag containing the specified character set.
Link
http://book.cakephp.org/1.3/en/The-Manual/Core-Helpers/HTML.html#charset

css() public ¶

css( mixed $path , string $rel = null , array $options = array() )

Creates a link element for CSS stylesheets.

Options

  • inline If set to false, the generated tag appears in the head tag of the layout. Defaults to true
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 $options optional array()
Array of HTML attributes.
Returns
string
CSS or