Base class for all CONTENIDO HTML classes
package | Core |
---|---|
subpackage | Frontend |
__construct(array $attributes) : void
array
Associative array of table tag attributes
__toString() : string
string
Generated markupaddRequiredScript(string $script) : \cHTML
Anyway, scripts are not included twice.
string
the script to include
\cHTML
$thisadvanceID() : \cHTML
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.
\cHTML
$thisappendStyleDefinition(string $property, string $value) : \cHTML
Example usage: $element->appendStyleDefinition('margin', '5px');
string
the property name, e.g. 'margin'
string
the value of the property, e.g. '5px'
\cHTML
$thisappendStyleDefinitions(array $styles) : \cHTML
Example usage: $element->appendStyleDefinitions(array( 'margin' => '5px', 'padding' => '0' ));
string
the styles to append
\cHTML
$thisattachEventDefinition(string $name, string $event, string $code) : \cHTML
Example to attach an onClick handler: attachEventDefinition('foo', 'onClick', 'alert("foo");');
string
Defines the name of the event
string
Defines the event (e.g. onClick)
string
Defines the code
\cHTML
$thisattachStyleDefinition(string $name, string $definition) : \cHTML
This function is not restricted to a single style, e.g. you can set multiple style definitions as-is to the handler.
$example->attachStyle('myIdentifier', 'border: 1px solid black; white-space: nowrap'); $example->attachStyle('myIdentifier2', 'padding: 0px');
Results in:
style="border: 1px solid black; white-space: nowrap; padding: 0px;"
deprecated | [2012-07-23] Set the definition via appendStyleDefinition and do not use a name any more |
---|
string
Name for a style definition
string
Definition for the given entity
\cHTML
$thiscHTML()
deprecated | [2012-01-19] use __construct instead |
---|
display()
fillCloseSkeleton() : string
string
filled SGML closer skeletonfillSkeleton(string $attributes) : string
fillSkeleton fills the SGML opener tag with the specified attributes. Attributes need to be passed in the stringyfied variant.
string
Attributes to set
string
filled SGML opener skeletongetAttribute(string $attributeName) : string
string
Attribute name
string
null value or null if the attribute does not
existgetAttributes(bool $returnAsString) : array
bool
Whether to return the attributes as string
array
stringgetID() : string
string
current IDrender() : string
string
Generated markupsetAlt(string $alt) : \cHTML
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.
string
Text to set as the "alt" and "title" attribute
\cHTML
$thissetAttribute(string $attributeName, string $value) : \cHTML
string
Name of the attribute
string
Value of the attribute
\cHTML
$thissetContentlessTag(bool $contentlessTag) : \cHTML
deprecated | [2012-07-20] use $this->_contentLess directly or just use setContent() - this function sets the contentLess attribute to false |
---|
bool
\cHTML
$thissetEvent(string $event, string $action) : \cHTML
example: $item->setEvent('change','document.forms[0].submit');
string
Type of the event, e. g. "change" for "onchange"
string
Function or action to call (JavaScript Code)
\cHTML
$thissetGenerateXHTML(bool $value)
bool
setStyleDefinition(string $entity, string $definition) : \cHTML
deprecated | [2012-07-23] name change, use appendStyleDefinition |
---|
string
Entity to define
string
Definition for the given entity
\cHTML
$thistoHTML() : string
string
Generated markupupdateAttribute(string $name, string $value) : \cHTML
string
the name of the attribute
string
the value of the attribute with the given name
\cHTML
$thisupdateAttributes(array $attributes) : \cHTML
_appendContent(string | object | array $content) : \cHTML
string
object
array
String with the content or an object to render or an array of strings/objects.
\cHTML
$this_getAttrString(array $attributes) : string
array
Associative array with attributes
string
Attribute string in HTML format_parseAttributes(array $attributes) : array
array
Associative array with attributes
array
the parsed attributes_setContent(string | object | array $content) : \cHTML
string
object
array
String with the content or a cHTML object to render or an array of strings / objects.
\cHTML
$this$_attributes : array
$_content : string
$_contentlessTag : bool
$_eventDefinitions : array
$_generateXHTML : bool
$_idCounter : int
$_requiredScripts : array
$_skeletonClose : string
$_skeletonOpen : string
$_skeletonSingle : string
$_styleDefinitions : array
$_styleDefs : array
$_tag : string