Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • cHTML
  • cHTMLAlignmentTable
  • cHTMLArticle
  • cHTMLAside
  • cHTMLAudio
  • cHTMLButton
  • cHTMLCanvas
  • cHTMLCheckbox
  • cHTMLContentElement
  • cHTMLDiv
  • cHTMLFieldset
  • cHTMLFooter
  • cHTMLForm
  • cHTMLFormElement
  • cHTMLHeader
  • cHTMLHgroup
  • cHTMLHiddenField
  • cHTMLIFrame
  • cHTMLImage
  • cHTMLLabel
  • cHTMLLegend
  • cHTMLLink
  • cHTMLList
  • cHTMLListItem
  • cHTMLNav
  • cHTMLOptgroup
  • cHTMLOptionElement
  • cHTMLParagraph
  • cHTMLPasswordbox
  • cHTMLRadiobutton
  • cHTMLScript
  • cHTMLSection
  • cHTMLSelectElement
  • cHTMLSpan
  • cHTMLTable
  • cHTMLTableBody
  • cHTMLTableData
  • cHTMLTableHead
  • cHTMLTableHeader
  • cHTMLTableRow
  • cHTMLTextarea
  • cHTMLTextbox
  • cHTMLTime
  • cHTMLUpload
  • cHTMLVideo
  • Overview
  • Package
  • Class
  • Todo
  • Download

Class cHTML

Base class for all CONTENIDO HTML classes

Direct known subclasses

cGuiFoldingRow, cHTMLContentElement, cHTMLFormElement, cHTMLIFrame, cHTMLImage

Indirect known subclasses

cGuiObjectPager, cHTMLAlignmentTable, cHTMLDiv, cHTMLErrorMessageList, cHTMLFieldset, cHTMLFoldableErrorMessage, cHTMLFooter, cHTMLForm, cHTMLHeader, cHTMLHgroup, cHTMLHiddenField, cHTMLInfoMessage, cHTMLAlphaImage, cHTMLInputSelectElement, cHTMLLabel, cHTMLLanguageLink, cHTMLLegend, cHTMLLink, cHTMLList, cHTMLListItem, cHTMLNav, cHTMLOptgroup, cHTMLOptionElement, cHTMLArticle, cHTMLParagraph, cHTMLPasswordbox, cHTMLRadiobutton, cHTMLScript, cHTMLSection, cHTMLSelectElement, cHTMLSpan, cHTMLTable, cHTMLTableBody, cHTMLTableData, cHTMLAside, cHTMLTableHead, cHTMLTableHeader, cHTMLTableRow, cHTMLTextarea, cHTMLTextbox, cHTMLTime, cHTMLUpload, cHTMLVideo, NoteLink, NoteList, cHTMLAudio, NoteListItem, NoteView, TODOLink, cHTMLButton, cHTMLButtonLink, cHTMLCanvas, cHTMLCheckbox
Package: Core\GUI\HTML
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Simon Sprankel
Located at classes/html/class.html.php
Methods summary
public
# __construct( array $attributes = NULL )

Constructor Function.

Constructor Function.

Parameters

$attributes
Associative array of table tag attributes
public static
# setGenerateXHTML( boolean $value )

Setter for static $_generateXHTML property

Setter for static $_generateXHTML property

Parameters

$value
public cHTML
# advanceID( )

Advances to the next ID available in the system.

Advances to the next ID available in the system.

This function is useful if you need to use HTML elements in a loop, but don't want to re-create new objects each time.

Returns

cHTML
$this
public string
# getID( )

Returns the current ID

Returns the current ID

Returns

string
current ID
public cHTML
# setTag( string $tag )

Sets the HTML tag to $tag

Sets the HTML tag to $tag

Parameters

$tag
The new tag

Returns

cHTML
$this
public cHTML
# setAlt( string $alt, boolean $setTitle = true )

Sets the alt and title attributes

Sets the alt and title attributes

Sets the "alt" and "title" tags. Usually, "alt" is used for accessibility and "title" for mouse overs.

The title attribute is not overwritten if there is already a set value for it.

To set the text for all browsers for mouse over, set "alt" and "title". IE behaves incorrectly and shows "alt" on mouse over. Mozilla browsers only show "title" as mouse over.

Parameters

$alt
Text to set as the "alt" and "title" attribute
$setTitle
Whether title attribute should be set, too (optional, default: true)

Returns

cHTML
$this
public cHTML
# setID( string $id )

Sets the ID class

Sets the ID class

Parameters

$id
Text to set as the "id"

Returns

cHTML
$this
public cHTML
# setClass( string $class )

Sets the CSS class

Sets the CSS class

Parameters

$class
Text to set as the "class" attribute

Returns

cHTML
$this
public cHTML
# setStyle( string $style )

Sets the CSS style

Sets the CSS style

Parameters

$style
Text to set as the "style" attribute

Returns

cHTML
$this
public cHTML
# setEvent( string $event, string $action )

Adds an "on???" javascript event handler

Adds an "on???" javascript event handler

example: $item->setEvent('change', 'document.forms[0].submit');

Parameters

$event
Type of the event, e. g. "change" for "onchange"
$action
Function or action to call (JavaScript Code)

Returns

cHTML
$this
public cHTML
# unsetEvent( string $event )

Removes an event handler

Removes an event handler

example: $item->unsetEvent('change');

Parameters

$event
Type of the event

Returns

cHTML
$this
public string
# fillSkeleton( string $attributes )

Fills the open SGML tag skeleton

Fills the open SGML tag skeleton

fillSkeleton fills the SGML opener tag with the specified attributes. Attributes need to be passed in the stringyfied variant.

Parameters

$attributes
Attributes to set

Returns

string
filled SGML opener skeleton
public string
# fillCloseSkeleton( )

Fills the close skeleton

Fills the close skeleton

Returns

string
filled SGML closer skeleton
public cHTML
# appendStyleDefinition( string $property, string $value )

Appends the given style definition to the HTML element. Example usage: $element->appendStyleDefinition('margin', '5px');

Appends the given style definition to the HTML element. Example usage: $element->appendStyleDefinition('margin', '5px');

Parameters

$property
the property name, e.g. 'margin'
$value
the value of the property, e.g. '5px'

Returns

cHTML
$this
public cHTML
# appendStyleDefinitions( array $styles )

Appends the given style definitions to the HTML element. Example usage: $element->appendStyleDefinitions(array( 'margin' => '5px', 'padding' => '0' ));

Appends the given style definitions to the HTML element. Example usage: $element->appendStyleDefinitions(array( 'margin' => '5px', 'padding' => '0' ));

Parameters

$styles
the styles to append

Returns

cHTML
$this
public cHTML
# addRequiredScript( string $script )

Adds a required script to the current element. Anyway, scripts are not included twice.

Adds a required script to the current element. Anyway, scripts are not included twice.

Parameters

$script
the script to include

Returns

cHTML
$this
protected cHTML
# _setContent( string|object|array $content )

Sets the content of the object

Sets the content of the object

Parameters

$content

String with the content or a cHTML object to render or an array of strings / objects.

Returns

cHTML
$this
protected cHTML
# _appendContent( string|object|array $content )

Adds the given content to the already existing content of this object.

Adds the given content to the already existing content of this object.

Parameters

$content

String with the content or an object to render or an array of strings/objects.

Returns

cHTML
$this
public cHTML
# attachEventDefinition( string $name, string $event, string $code )

Attaches the code for an event

Attaches the code for an event

Example to attach an onClick handler: attachEventDefinition('foo', 'onClick', 'alert("foo");');

Parameters

$name
Defines the name of the event
$event
Defines the event (e.g. onClick)
$code
Defines the code

Returns

cHTML
$this
public cHTML
# setAttribute( string $attributeName, string $value = NULL )

Sets a specific attribute

Sets a specific attribute

Parameters

$attributeName
Name of the attribute
$value
Value of the attribute

Returns

cHTML
$this
public cHTML
# setAttributes( array $attributes )

Sets the HTML attributes

Sets the HTML attributes

Parameters

$attributes
Associative array with attributes

Returns

cHTML
$this
protected array
# _parseAttributes( array $attributes )

Returns a valid atrributes array.

Returns a valid atrributes array.

Parameters

$attributes
Associative array with attributes

Returns

array
the parsed attributes
public cHTML
# removeAttribute( string $attributeName )

Removes an attribute

Removes an attribute

Parameters

$attributeName
Attribute name

Returns

cHTML
$this
public string
# getAttribute( string $attributeName )

Returns the value of the given attribute.

Returns the value of the given attribute.

Parameters

$attributeName
Attribute name

Returns

string

NULL value or NULL if the attribute does not exist

public cHTML
# updateAttribute( string $name, string $value )

Updates the passed attribute without changing the other existing attributes

Updates the passed attribute without changing the other existing attributes

Parameters

$name
the name of the attribute
$value
the value of the attribute with the given name

Returns

cHTML
$this
public cHTML
# updateAttributes( array $attributes )

Updates the passed attributes without changing the other existing attributes

Updates the passed attributes without changing the other existing attributes

Parameters

$attributes
Associative array with attributes

Returns

cHTML
$this
protected string
# _getAttrString( array $attributes )

Returns an HTML formatted attribute string

Returns an HTML formatted attribute string

Parameters

$attributes
Associative array with attributes

Returns

string
Attribute string in HTML format
public array
# getAttributes( boolean $returnAsString = false )

Returns the assoc array(default) or string of attributes

Returns the assoc array(default) or string of attributes

Parameters

$returnAsString
Whether to return the attributes as string

Returns

array
string
public string
# toHTML( )

Generates the markup of the element

Generates the markup of the element

Returns

string
Generated markup
public string
# render( )

Alias for toHtml

Alias for toHtml

Returns

string
Generated markup
public string
# __toString( )

Direct call of object as string will return it's generated markup.

Direct call of object as string will return it's generated markup.

Returns

string
Generated markup
public
# display( )

Outputs the generated markup

Outputs the generated markup

Properties summary
protected static integer $_idCounter

Id attribute counter, used to generate unique values for id-attributes

Id attribute counter, used to generate unique values for id-attributes

# 0
protected static boolean $_generateXHTML

Flag to generate XHTML valid elements

Flag to generate XHTML valid elements

#
protected string $_skeletonOpen

Storage of the open SGML tag template

Storage of the open SGML tag template

# '<%s%s>'
protected string $_skeletonSingle

Storage of a single SGML tag template

Storage of a single SGML tag template

#
protected string $_skeletonClose

Storage of the close SGML tag

Storage of the close SGML tag

# '</%s>'
protected string $_tag

Defines which tag to use

Defines which tag to use

#
protected array $_styleDefs

Defines the style definitions

Defines the style definitions

# array()
protected array $_requiredScripts

Defines all scripts which are required by the current element

Defines all scripts which are required by the current element

# array()
protected boolean $_contentlessTag

Defines if the current tag is a contentless tag

Defines if the current tag is a contentless tag

# true
protected array $_eventDefinitions

Defines which JS events contain which scripts

Defines which JS events contain which scripts

# array()
protected array $_styleDefinitions

Style definitions

Style definitions

# array()
protected array $_attributes

Attributes

Attributes

#
protected string $_content

The content itself

The content itself

#
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen