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

Class: HTML_Common

Source Location: /HTML_Common-1.2.5/Common.php

Class Overview


Base class for all HTML classes


Author(s):

Version:

  • Release: 1.2.5

Methods


Inherited Variables

Inherited Methods


Class Details

[line 33]
Base class for all HTML classes


[ Top ]


Method Detail

HTML_Common (Constructor)   [line 80]

HTML_Common HTML_Common( [mixed $attributes = null], [int $tabOffset = 0])

Class constructor
  • Access: public

Parameters:

mixed   $attributes   —  Associative array of table tag attributes or HTML attributes name="value" pairs
int   $tabOffset   —  Indent offset in tabs

[ Top ]

apiVersion   [line 91]

double apiVersion( )

Returns the current API version
  • Access: public

[ Top ]

charset   [line 455]

string charset( [string $newCharset = null])

Sets the charset to use by htmlspecialchars() function

Since this parameter is expected to be global, the function is designed to be called statically:

  1.  HTML_Common::charset('utf-8');
or
  1.  $charset HTML_Common::charset();

  • Return: Current charset
  • Access: public

Parameters:

string   $newCharset   —  New charset to use. Omit if just getting the current value. Consult the htmlspecialchars() docs for a list of supported character sets.

[ Top ]

display   [line 430]

void display( )

Displays the HTML to the screen
  • Access: public

[ Top ]

getAttribute   [line 252]

string|null getAttribute( string $attr)

Returns the value of the given attribute
  • Return: returns null if an attribute does not exist
  • Since: 1.5
  • Access: public

Parameters:

string   $attr   —  Attribute name

[ Top ]

getAttributes   [line 295]

mixed getAttributes( [bool $asString = false])

Returns the assoc array (default) or string of attributes
  • Return: attributes
  • Since: 1.6
  • Access: public

Parameters:

bool   $asString   —  Whether to return the attributes as string

[ Top ]

getComment   [line 408]

string getComment( )

Returns the HTML comment
  • Since: 1.5
  • Access: public

[ Top ]

getTabOffset   [line 370]

int getTabOffset( )

Returns the tabOffset
  • Since: 1.5
  • Access: public

[ Top ]

removeAttribute   [line 322]

void removeAttribute( string $attr)

Removes an attribute
  • Since: 1.4
  • Access: public

Parameters:

string   $attr   —  Attribute name

[ Top ]

setAttribute   [line 268]

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 282]

void setAttributes( mixed $attributes)

Sets the HTML attributes
  • Access: public

Parameters:

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

[ Top ]

setComment   [line 396]

void setComment( string $comment)

Sets the HTML comment to be displayed at the beginning of the HTML string
  • Since: 1.4
  • Access: public

Parameters:

string   $comment   — 

[ Top ]

setLineEnd   [line 335]

void setLineEnd( string $style)

Sets the line end style to Windows, Mac, Unix or a custom string.
  • Since: 1.7
  • Access: public

Parameters:

string   $style   —  "win", "mac", "unix" or custom string.

[ Top ]

setTab   [line 383]

void setTab( string $string)

Sets the string used to indent HTML
  • Since: 1.7
  • Access: public

Parameters:

string   $string   —  String used to indent ("\11", "\t", ' ', etc.).

[ Top ]

setTabOffset   [line 358]

void setTabOffset( int $offset)

Sets the tab offset
  • Access: public

Parameters:

int   $offset   — 

[ Top ]

toHtml   [line 420]

string toHtml( )

Abstract method. Must be extended to return the objects HTML
  • Abstract:
  • Access: public

[ Top ]

updateAttributes   [line 309]

void updateAttributes( mixed $attributes)

Updates the passed attributes without changing the other existing attributes
  • Access: public

Parameters:

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

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:30:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.