apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: HTML_Common2

Source Location: /HTML_Common2-0.1.0/Common2.php

Class Overview


Base class for HTML classes


Author(s):

Version:

  • $Revision: 1.2 $

Methods


Inherited Variables

Inherited Methods


Class Details

[line 30]
Base class for HTML classes

Implements methods for working with HTML attributes, parsing and generating attribute strings. Port of HTML_Common class for PHP4 originally written by Adam Daniel with contributions from numerous other developers.

  • Author: Alexey Borzov <avb@php.net>
  • Version: $Revision: 1.2 $
  • Abstract:


[ Top ]


Method Detail

__construct (Constructor)   [line 170]

HTML_Common2 __construct( [mixed $attributes = null])

Class constructor, sets default attributes
  • Access: public

Parameters:

mixed   $attributes   —  Array of attribute 'name' => 'value' pairs or HTML attribute string

[ Top ]

display   [line 310]

void display( )

Displays the element
  • Access: public

[ Top ]

getAttribute   [line 196]

string getAttribute( string $name)

Returns the value of an attribute
  • Return: Attribute value, null if attribute does not exist
  • Access: public

Parameters:

string   $name   —  Attribute name

[ Top ]

getAttributes   [line 218]

mixed getAttributes( [bool $asString = false])

Returns the attribute array or string
  • Return: Either an array or string of attributes
  • Access: public

Parameters:

bool   $asString   —  Whether to return attributes as string

[ Top ]

getAttributesString   [line 153]

string getAttributesString( array $attributes)

Creates HTML attribute string from array
  • Return: Attribute string
  • Access: protected

Parameters:

array   $attributes   —  Attribute array

[ Top ]

getComment   [line 295]

string getComment( )

Returns the comment associated with the element
  • Access: public

[ Top ]

getIndent   [line 275]

string getIndent( )

Returns the string to indent the element
  • Access: protected

[ Top ]

getIndentLevel   [line 265]

int getIndentLevel( )

Gets the indentation level
  • Access: public

[ Top ]

getOption   [line 87]

mixed getOption( string $name)

Gets a global option
  • Return: Option value, null if option does not exist
  • Access: public

Parameters:

string   $name   —  Option name

[ Top ]

mergeAttributes   [line 232]

void mergeAttributes( mixed $attributes)

Merges the existing attributes with the new ones
  • Access: public

Parameters:

mixed   $attributes   —  Array of attribute 'name' => 'value' pairs or HTML attribute string

[ Top ]

parseAttributes   [line 98]

array parseAttributes( mixed $attributes)

Creates a valid attribute array from either a string or an array
  • Return: An associative aray of attributes
  • Access: protected

Parameters:

mixed   $attributes   —  Array of attributes or HTML attribute string

[ Top ]

removeAttribute   [line 242]

void removeAttribute( string $attribute)

Removes an attribute
  • Access: public

Parameters:

string   $attribute   —  Name of attribute to remove

[ Top ]

removeAttributeArray   [line 139]

void removeAttributeArray( array &$attributes, string $name)

Removes an attribute from an attribute array
  • Access: protected

Parameters:

array   &$attributes   —  Attribute array
string   $name   —  Name of attribute to remove

[ Top ]

setAttribute   [line 181]

void setAttribute( string $name, [string $value = null])

Sets the value of the attribute
  • Access: public

Parameters:

string   $name   —  Attribute name
string   $value   —  Attribute value (will be set to $name if omitted)

[ Top ]

setAttributes   [line 207]

void setAttributes( mixed $attributes)

Sets the attributes
  • Access: public

Parameters:

mixed   $attributes   —  Array of attribute 'name' => 'value' pairs or HTML attribute string

[ Top ]

setComment   [line 285]

void setComment( string $comment)

Sets the comment for the element
  • Access: public

Parameters:

string   $comment   — 

[ Top ]

setIndentLevel   [line 252]

void setIndentLevel( int $level)

Sets the indentation level
  • Access: public

Parameters:

int   $level   — 

[ Top ]

setOption   [line 72]

void setOption( string $name, mixed $value)

Sets a global option
  • Access: public

Parameters:

string   $name   —  Option name
mixed   $value   —  Option value

[ Top ]

toHtml   [line 305]

string toHtml( )

Returns the HTML representation of the element
  • Abstract:
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:57:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.