[ PHPXref.com ] [ Generated: Sun Jul 20 17:09:16 2008 ] [ Dataface 0.5.4 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/lib/HTML/ -> Common.php (summary)

(no description)

File Size: 420 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTML_Common:: (23 methods):
  HTML_Common()
  apiVersion()
  _getLineEnd()
  _getTab()
  _getTabs()
  _getAttrString()
  _parseAttributes()
  _getAttrKey()
  _updateAttrArray()
  _removeAttr()
  getAttribute()
  setAttributes()
  getAttributes()
  updateAttributes()
  removeAttribute()
  setLineEnd()
  setTabOffset()
  getTabOffset()
  setTab()
  setComment()
  getComment()
  toHtml()
  display()


Class: HTML_Common  - X-Ref

Base class for all HTML classes

HTML_Common($attributes = null, $tabOffset = 0)   X-Ref
Class constructor

param: mixed   $attributes     Associative array of table tag attributes
param: int     $tabOffset      Indent offset in tabs

apiVersion()   X-Ref
Returns the current API version

returns: double

_getLineEnd()   X-Ref
Returns the lineEnd

return: string

_getTab()   X-Ref
Returns a string containing the unit for indenting HTML

return: string

_getTabs()   X-Ref
Returns a string containing the offset for the whole HTML code

return: string

_getAttrString($attributes)   X-Ref
Returns an HTML formatted attribute string

param: array   $attributes
return: string

_parseAttributes($attributes)   X-Ref
Returns a valid atrributes array from either a string or array

param: mixed   $attributes     Either a typical HTML attribute string or an associative array

_getAttrKey($attr, $attributes)   X-Ref
Returns the array key for the given non-name-value pair attribute

param: string    $attr         Attribute
param: array     $attributes   Array of attribute
return: array key

_updateAttrArray(&$attr1, $attr2)   X-Ref
Updates the attributes in $attr1 with the values in $attr2 without changing the other existing attributes

param: array   $attr1      Original attributes array
param: array   $attr2      New attributes array
return: array

_removeAttr($attr, &$attributes)   X-Ref
Removes the given attribute from the given array

param: string    $attr           Attribute name
param: array     $attributes     Attribute array
return: void

getAttribute($attr)   X-Ref
Returns the value of the given attribute

param: string    $attr   Attribute name
return: void

setAttributes($attributes)   X-Ref
Sets the HTML attributes

param: mixed   $attributes     Either a typical HTML attribute string or an associative array

getAttributes($asString = false)   X-Ref
Returns the assoc array (default) or string of attributes

param: bool    Whether to return the attributes as string
return: mixed   attributes

updateAttributes($attributes)   X-Ref
Updates the passed attributes without changing the other existing attributes

param: mixed   $attributes     Either a typical HTML attribute string or an associative array

removeAttribute($attr)   X-Ref
Removes an attribute

param: string    $attr   Attribute name
return: void

setLineEnd($style)   X-Ref
Sets the line end style to Windows, Mac, Unix or a custom string.

param: string  $style  "win", "mac", "unix" or custom string.
return: void

setTabOffset($offset)   X-Ref
Sets the tab offset

param: int     $offset

getTabOffset()   X-Ref
Returns the tabOffset

return: int

setTab($string)   X-Ref
Sets the string used to indent HTML

param: string    $string     String used to indent ("\11", "\t", '  ', etc.).
return: void

setComment($comment)   X-Ref
Sets the HTML comment to be displayed at the beginning of the HTML string

param: string
return: void

getComment()   X-Ref
Returns the HTML comment

return: string

toHtml()   X-Ref
Abstract method.  Must be extended to return the objects HTML

return: string

display()   X-Ref
Displays the HTML to the screen




[ Powered by PHPXref - Served by Debian GNU/Linux ]