cHTMLLink class represents a link.
Methods
Constructor.
__construct($itemtype, $itemid, $subject, $message) : void
Parameters
$itemtype
$itemid
$subject
$message
Direct call of object as string will return it's generated markup.
__toString() : string
Inherited
| inherited_from |
\cHTML::__toString() |
| inherited_from |
\cHTMLLink::__toString() |
Returns
stringGenerated markup
Adds a required script to the current element.
addRequiredScript(string $script) : \cHTML
Inherited
Anyway, scripts are not included twice.
| inherited_from |
\cHTML::addRequiredScript() |
| inherited_from |
\cHTMLLink::addRequiredScript() |
Parameters
$script
stringthe script to include
Returns
Advances to the next ID available in the system.
advanceID() : \cHTML
Inherited
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.
| inherited_from |
\cHTML::advanceID() |
| inherited_from |
\cHTMLLink::advanceID() |
Returns
Appends code / objects to the content.
appendContent(string | object | array $content) : \cHTMLDiv
Inherited
| inherited_from |
\cHTMLLink::appendContent() |
Parameters
$content
stringobjectarrayString with the content or a cHTML
object to render or an array of strings / objects.
Returns
Appends the given style definition to the HTML element.
appendStyleDefinition(string $property, string $value) : \cHTML
Inherited
Example usage:
$element->appendStyleDefinition('margin', '5px');
| inherited_from |
\cHTML::appendStyleDefinition() |
| inherited_from |
\cHTMLLink::appendStyleDefinition() |
Parameters
$property
stringthe property name, e.g. 'margin'
$value
stringthe value of the property, e.g. '5px'
Returns
Appends the given style definitions to the HTML element.
appendStyleDefinitions(array $styles) : \cHTML
Inherited
Example usage:
$element->appendStyleDefinitions(array(
'margin' => '5px',
'padding' => '0'
));
| inherited_from |
\cHTML::appendStyleDefinitions() |
| inherited_from |
\cHTMLLink::appendStyleDefinitions() |
Parameters
$styles
stringthe styles to append
Returns
Attaches the code for an event
attachEventDefinition(string $name, string $event, string $code) : \cHTML
Inherited
Example to attach an onClick handler:
attachEventDefinition('foo', 'onClick', 'alert("foo");');
| inherited_from |
\cHTML::attachEventDefinition() |
| inherited_from |
\cHTMLLink::attachEventDefinition() |
Parameters
$name
stringDefines the name of the event
$event
stringDefines the event (e.g. onClick)
$code
stringDefines the code
Returns
Attaches a style definition.
attachStyleDefinition(string $name, string $definition) : \cHTML
Inherited
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;"
| inherited_from |
\cHTML::attachStyleDefinition() |
| inherited_from |
\cHTMLLink::attachStyleDefinition() |
Parameters
$name
stringName for a style definition
$definition
stringDefinition for the given entity
Returns
cHTML()
cHTML()
Inherited
| inherited_from |
\cHTML::cHTML() |
| inherited_from |
\cHTMLLink::cHTML() |
disableAutomaticParameterAppend()
disableAutomaticParameterAppend()
Inherited
| inherited_from |
\cHTMLLink::disableAutomaticParameterAppend() |
Outputs the generated markup
display()
Inherited
| inherited_from |
\cHTML::display() |
| inherited_from |
\cHTMLLink::display() |
enableAutomaticParameterAppend()
enableAutomaticParameterAppend()
Inherited
| inherited_from |
\cHTMLLink::enableAutomaticParameterAppend() |
Fills the close skeleton
fillCloseSkeleton() : string
Inherited
| inherited_from |
\cHTML::fillCloseSkeleton() |
| inherited_from |
\cHTMLLink::fillCloseSkeleton() |
Returns
stringfilled SGML closer skeleton
Fills the open SGML tag skeleton
fillSkeleton(string $attributes) : string
Inherited
fillSkeleton fills the SGML opener tag with the
specified attributes. Attributes need to be passed
in the stringyfied variant.
| inherited_from |
\cHTML::fillSkeleton() |
| inherited_from |
\cHTMLLink::fillSkeleton() |
Parameters
$attributes
stringAttributes to set
Returns
stringfilled SGML opener skeleton
Returns the value of the given attribute.
getAttribute(string $attributeName) : string
Inherited
| inherited_from |
\cHTML::getAttribute() |
| inherited_from |
\cHTMLLink::getAttribute() |
Parameters
$attributeName
stringAttribute name
Returns
stringnull value or null if the attribute does not
exist
Returns the assoc array(default) or string of attributes
getAttributes(bool $returnAsString) : array
Inherited
| inherited_from |
\cHTML::getAttributes() |
| inherited_from |
\cHTMLLink::getAttributes() |
Parameters
$returnAsString
boolWhether to return the attributes as string
Returns
arraystring
getHref()
getHref()
Inherited
| inherited_from |
\cHTMLLink::getHref() |
Returns the current ID
getID() : string
Inherited
| inherited_from |
\cHTML::getID() |
| inherited_from |
\cHTMLLink::getID() |
Returns
stringcurrent ID
Removes an attribute
removeAttribute(string $attributeName) : \cHTML
Inherited
| inherited_from |
\cHTML::removeAttribute() |
| inherited_from |
\cHTMLLink::removeAttribute() |
Parameters
$attributeName
stringAttribute name
Returns
Alias for toHtml
render() : string
Inherited
| inherited_from |
\cHTML::render() |
| inherited_from |
\cHTMLLink::render() |
Returns
stringGenerated markup
Sets the alt and title attributes
setAlt(string $alt) : \cHTML
Inherited
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.
| inherited_from |
\cHTML::setAlt() |
| inherited_from |
\cHTMLLink::setAlt() |
Parameters
$alt
stringText to set as the "alt" and "title" attribute
Returns
Sets an anchor
Only works for the link types Link and cLink.
setAnchor($anchor) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setAnchor() |
Parameters
$anchor
Returns
Sets a specific attribute
setAttribute(string $attributeName, string $value) : \cHTML
Inherited
| inherited_from |
\cHTML::setAttribute() |
| inherited_from |
\cHTMLLink::setAttribute() |
Parameters
$attributeName
stringName of the attribute
$value
stringValue of the attribute
Returns
Sets the HTML attributes
setAttributes(array $attributes) : \cHTML
Inherited
| inherited_from |
\cHTML::setAttributes() |
| inherited_from |
\cHTMLLink::setAttributes() |
Parameters
$attributes
arrayAssociative array with attributes
Returns
Sets a CONTENIDO link (area, frame, action)
setCLink(string $targetarea, string $targetframe, string $targetaction) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setCLink() |
Parameters
$targetarea
stringTarget backend area
$targetframe
stringTarget frame (1-4)
$targetaction
stringTarget action
Returns
Sets the CSS class
setClass(string $class) : \cHTML
Inherited
| inherited_from |
\cHTML::setClass() |
| inherited_from |
\cHTMLLink::setClass() |
Parameters
$class
stringText to set as the "class" attribute
Returns
Sets the link's content
setContent(string | object | array $content) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setContent() |
Parameters
$content
stringobjectarrayString with the content or a cHTML
object to render or an array of strings / objects.
Returns
Contentless tag setter
setContentlessTag(bool $contentlessTag) : \cHTML
Inherited
| inherited_from |
\cHTML::setContentlessTag() |
| inherited_from |
\cHTMLLink::setContentlessTag() |
Parameters
$contentlessTag
bool
Returns
Sets a custom attribute to be appended to the link
setCustom(string $key, string $value) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setCustom() |
Parameters
$key
stringParameter name
$value
stringParameter value
Returns
Adds an "on???" javascript event handler
setEvent(string $event, string $action) : \cHTML
Inherited
example:
$item->setEvent('change','document.forms[0].submit');
| inherited_from |
\cHTML::setEvent() |
| inherited_from |
\cHTMLLink::setEvent() |
Parameters
$event
stringType of the event, e. g. "change" for "onchange"
$action
stringFunction or action to call (JavaScript Code)
Returns
Setter for static $_generateXHTML property
setGenerateXHTML(bool $value)
InheritedStatic
| inherited_from |
\cHTML::setGenerateXHTML() |
| inherited_from |
\cHTMLLink::setGenerateXHTML() |
Parameters
$value
bool
Sets the ID class
setID(string $id) : \cHTML
Inherited
| inherited_from |
\cHTML::setID() |
| inherited_from |
\cHTMLLink::setID() |
Parameters
$id
stringText to set as the "id"
Returns
setImage()
setImage($src)
Inherited
| inherited_from |
\cHTMLLink::setImage() |
Parameters
$src
Sets the link to a specific location
setLink(string $href) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setLink() |
Parameters
$href
stringString with the location to link to
Returns
Sets a multilink
setMultiLink(string $righttoparea, string $righttopaction, string $rightbottomarea, string $rightbottomaction) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setMultiLink() |
Parameters
$righttoparea
stringArea (right top)
$righttopaction
stringAction (right top)
$rightbottomarea
stringArea (right bottom)
$rightbottomaction
stringAction (right bottom)
Returns
Sets the CSS style
setStyle(string $style) : \cHTML
Inherited
| inherited_from |
\cHTML::setStyle() |
| inherited_from |
\cHTMLLink::setStyle() |
Parameters
$style
stringText to set as the "style" attribute
Returns
setStyleDefinition()
setStyleDefinition(string $entity, string $definition) : \cHTML
Inherited
| inherited_from |
\cHTML::setStyleDefinition() |
| inherited_from |
\cHTMLLink::setStyleDefinition() |
Parameters
$entity
stringEntity to define
$definition
stringDefinition for the given entity
Returns
Sets the HTML tag to $tag
setTag(string $tag) : \cHTML
Inherited
| inherited_from |
\cHTML::setTag() |
| inherited_from |
\cHTMLLink::setTag() |
Parameters
Returns
Sets the target frame
setTargetFrame(string $target) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::setTargetFrame() |
Parameters
$target
stringTarget frame identifier
Returns
Renders the link
toHTML() : string
Inherited
| inherited_from |
\cHTMLLink::toHTML() |
Returns
stringRendered HTML
Unsets a previous set custom attribute
unsetCustom(string $key) : \cHTMLLink
Inherited
| inherited_from |
\cHTMLLink::unsetCustom() |
Parameters
$key
stringParameter name
Returns
Removes an event handler
unsetEvent(string $event) : \cHTML
Inherited
example:
$item->unsetEvent('change');
| inherited_from |
\cHTML::unsetEvent() |
| inherited_from |
\cHTMLLink::unsetEvent() |
Parameters
$event
stringType of the event
Returns
Updates the passed attribute without changing the other existing
attributes
updateAttribute(string $name, string $value) : \cHTML
Inherited
| inherited_from |
\cHTML::updateAttribute() |
| inherited_from |
\cHTMLLink::updateAttribute() |
Parameters
$name
stringthe name of the attribute
$value
stringthe value of the attribute with the given name
Returns
Updates the passed attributes without changing the other existing
attributes
updateAttributes(array $attributes) : \cHTML
Inherited
| inherited_from |
\cHTML::updateAttributes() |
| inherited_from |
\cHTMLLink::updateAttributes() |
Parameters
$attributes
arrayAssociative array with attributes
Returns
Adds the given content to the already existing content of this object.
_appendContent(string | object | array $content) : \cHTML
Inherited
| inherited_from |
\cHTML::_appendContent() |
| inherited_from |
\cHTMLLink::_appendContent() |
Parameters
$content
stringobjectarrayString with the content or an object
to
render or an array of strings/objects.
Returns
Returns an HTML formatted attribute string
_getAttrString(array $attributes) : string
Inherited
| inherited_from |
\cHTML::_getAttrString() |
| inherited_from |
\cHTMLLink::_getAttrString() |
Parameters
$attributes
arrayAssociative array with attributes
Returns
stringAttribute string in HTML format
Returns a valid atrributes array.
_parseAttributes(array $attributes) : array
Inherited
| inherited_from |
\cHTML::_parseAttributes() |
| inherited_from |
\cHTMLLink::_parseAttributes() |
Parameters
$attributes
arrayAssociative array with attributes
Returns
arraythe parsed attributes
Sets the content of the object
_setContent(string | object | array $content) : \cHTML
Inherited
| inherited_from |
\cHTML::_setContent() |
| inherited_from |
\cHTMLLink::_setContent() |
Parameters
$content
stringobjectarrayString with the content or a cHTML
object to render or an array of strings / objects.
Returns
Properties
$_anchor
Inherited
| inherited_from |
\cHTMLLink::$$_anchor |
$_attributes : array
Inherited
| inherited_from |
\cHTML::$$_attributes |
| inherited_from |
\cHTMLLink::$$_attributes |
$_content : string
Inherited
| inherited_from |
\cHTMLLink::$$_content |
$_contentlessTag : bool
Inherited
| inherited_from |
\cHTML::$$_contentlessTag |
| inherited_from |
\cHTMLLink::$$_contentlessTag |
$_custom
Inherited
| inherited_from |
\cHTMLLink::$$_custom |
$_eventDefinitions : array
Inherited
| inherited_from |
\cHTML::$$_eventDefinitions |
| inherited_from |
\cHTMLLink::$$_eventDefinitions |
$_generateXHTML : bool
Inherited
| inherited_from |
\cHTML::$$_generateXHTML |
| inherited_from |
\cHTMLLink::$$_generateXHTML |
$_idCounter : int
Inherited
| inherited_from |
\cHTML::$$_idCounter |
| inherited_from |
\cHTMLLink::$$_idCounter |
$_image
Inherited
| inherited_from |
\cHTMLLink::$$_image |
$_link
Inherited
| inherited_from |
\cHTMLLink::$$_link |
$_requiredScripts : array
Inherited
| inherited_from |
\cHTML::$$_requiredScripts |
| inherited_from |
\cHTMLLink::$$_requiredScripts |
$_skeletonClose : string
Inherited
| inherited_from |
\cHTML::$$_skeletonClose |
| inherited_from |
\cHTMLLink::$$_skeletonClose |
$_skeletonOpen : string
Inherited
| inherited_from |
\cHTML::$$_skeletonOpen |
| inherited_from |
\cHTMLLink::$$_skeletonOpen |
$_skeletonSingle : string
Inherited
| inherited_from |
\cHTML::$$_skeletonSingle |
| inherited_from |
\cHTMLLink::$$_skeletonSingle |
$_styleDefinitions : array
Inherited
| inherited_from |
\cHTML::$$_styleDefinitions |
| inherited_from |
\cHTMLLink::$$_styleDefinitions |
$_styleDefs : array
Inherited
| inherited_from |
\cHTML::$$_styleDefs |
| inherited_from |
\cHTMLLink::$$_styleDefs |
$_tag : string
Inherited
| inherited_from |
\cHTML::$$_tag |
| inherited_from |
\cHTMLLink::$$_tag |