Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • 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

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
  • Tree
  • Deprecated
  • Todo

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
array
$attributes Associative array of table tag attributes
public static
# setGenerateXHTML( boolean $value )

Setter for static $_generateXHTML property

Setter for static $_generateXHTML property

Parameters

$value
boolean
$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
string
$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.

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
string
$alt Text to set as the "alt" and "title" attribute
$setTitle
boolean
$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
string
$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
string
$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
string
$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
string
$event Type of the event, e. g. "change" for "onchange"
$action
string
$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
string
$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
string
$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
string
$property the property name, e.g. 'margin'
$value
string
$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
string
$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
string
$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|object|array
$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|object|array
$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
string
$name Defines the name of the event
$event
string
$event Defines the event (e.g. onClick)
$code
string
$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
string
$attributeName Name of the attribute
$value
string
$value Value of the attribute

Returns

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

Sets the HTML attributes

Sets the HTML attributes

Parameters

$attributes
array
$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
array
$attributes Associative array with attributes

Returns

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

Removes an attribute

Removes an attribute

Parameters

$attributeName
string
$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
string
$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
string
$name the name of the attribute
$value
string
$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
array
$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
array
$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
boolean
$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 0
#

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

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

protected static boolean $_generateXHTML
#

Flag to generate XHTML valid elements

Flag to generate XHTML valid elements

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

Storage of the open SGML tag template

Storage of the open SGML tag template

protected string $_skeletonSingle
#

Storage of a single SGML tag template

Storage of a single SGML tag template

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

Storage of the close SGML tag

Storage of the close SGML tag

protected string $_tag
#

Defines which tag to use

Defines which tag to use

protected array $_styleDefs array()
#

Defines the style definitions

Defines the style definitions

protected array $_requiredScripts array()
#

Defines all scripts which are required by the current element

Defines all scripts which are required by the current element

protected boolean $_contentlessTag true
#

Defines if the current tag is a contentless tag

Defines if the current tag is a contentless tag

protected array $_eventDefinitions array()
#

Defines which JS events contain which scripts

Defines which JS events contain which scripts

protected array $_styleDefinitions array()
#

Style definitions

Style definitions

protected array $_attributes
#

Attributes

Attributes

protected string $_content
#

The content itself

The content itself

CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0