Class HTMLTagClass

Description

Base class for all HTML Tag classes.

Tag class renders an html tag, its attributes, the content (if any), and close tag (if needed).

Located in /HTMLTagClass.inc (line 31)

Container
   |
   --XMLTagClass
      |
      --HTMLTagClass
Direct descendents
Class Description
Atag <A> tag class
ABBRtag <ABBR> tag class
ACRONYMtag <ACRONYM> tag class
ADDRESStag <ADDRESS> tag class
APPLETtag <APPLET> tag class
AREAtag <AREA> tag class
Btag
BASEtag <BASE> tag class
BDOtag <BDO> tag class
BIGtag <BIG> tag class
BLOCKQUOTEtag <BLOCKQUOTE> tag class
BODYtag <BODY> tag class
BRtag
tag class
BUTTONtag <BUTTON> tag class
CAPTIONtag <CAPTION> tag class This element defines a table caption.
CENTERtag <CENTER> tag class.
CITEtag <CITE> tag class
CODEtag
COLtag <COL> tag class
COLGROUPtag <COLGROUP> tag class
DDtag <DD> tag class
DELtag <DEL> tag class
DFNtag <DFN> tag class
DIVtag <DIV> tag class
DLtag <DL> tag class
DOCTYPEtag <!DOCTYPE> tag class
DTtag <DT> tag class
EMtag <EM> tag class
FIELDSETtag <FIELDSET> tag class
FONTtag <FONT> tag class
FORMtag FORMtag <FORM> tag
FRAMEtag <FRAME> tag class
FRAMESETtag <FRAMESET> tag class
H1tag <H1> tag class
H2tag <H2> tag class
H3tag <H3> tag class
H4tag <H4> tag class
H5tag <H5> tag class
H6tag <H6> tag class
HEADtag <HEAD> tag class
HRtag <HR> tag class
HTMLtag <HTML> tag class.
Itag
IFRAMEtag <IFRAME> tag class
IMGtag <IMG> tag class
INPUTtag INPUTtag <INPUT> tag
INStag <INS> tag class
KBDtag
LABELtag <LABEL> tag class
LEGENDtag <LEGEND> tag class
LItag <LI> tag class
LINKtag <LINK> tag class
MAPtag <MAP> tag class
METAtag <META> tag class
NOBRtag <NOBR> tag class
NOFRAMEStag <NOFRAMES> tag class
NOSCRIPTtag <NOSCRIPT> tag class
OBJECTtag <OBJECT> tag class
OLtag
OPTGROUPtag <OPTGROUP> tag class
OPTIONtag <OPTION> tag class
Ptag <P> tag class
PARAMtag <PARAM> tag class
PREtag
Qtag <Q> tag class
Stag <S> tag class
SAMPtag
SCRIPTtag <SCRIPT> tag class
SELECTtag <SELECT> tag class
SMALLtag <SMALL> tag class
SPANtag <SPAN> tag class
STRONGtag <STRONG> tag class
STYLEtag <STYLE> tag class
SUBtag <SUB> tag class
SUPtag <SUP> tag class
TABLEtag <TABLE> tag class
TEXTAREAtag <TEXTAREA> tag class
THtag Table Header <TH> class.
TITLEtag <TITLE> tag class
TRtag Table Row <TR> class.
TTtag <TT> tag class
Utag <U> tag class
VARtag
XMPtag <XMP> tag class
Method Summary
HTMLTagClass HTMLTagClass ([array $attributes = NULL], mixed 1)
string render ([int $indent_level = NULL], [boolean $output_debug = 0])
none set_class (string $value)
none set_id (string $value)
none set_style (string $value)
Methods
Constructor HTMLTagClass (line 90)

Class Constructor

  1. function HTMLTagClass$attributes=NULL {
  2.         if $attributes {
  3.             $this->set_tag_attributes$attributes );
  4.         }
  5.  
  6.         //set the default tag options 
  7.         $this->_set_flags();
  8.  
  9.         //add the content if any.
  10.         $num_args func_num_args();
  11.         for ($i 1$i $num_args$i++{
  12.             $this->add(func_get_arg($i));
  13.         }
  14.  
  15.         //what version of html is this tag going to
  16.         //be rendered as?
  17.         //this is a magic test.  It assumes that
  18.         //someone has created the define for
  19.         //HTML_RENDER_TYPE
  20.         if $GLOBALS["HTML_RENDER_TYPE"== XHTML ||
  21.              $GLOBALS["HTML_RENDER_TYPE"== XHTML_STRICT {
  22.             $this->_flags |= _XHTMLCOMPLIANT;
  23.  
  24.         }
  25.  
  26.         //if the tag is depricated
  27.         //we raise an alert.
  28.         if $this->_flags _DEPRICATED {
  29.             trigger_error(htmlspecialchars($this->_tag" has been depricated in HTML 4.0"E_USER_NOTICE);
  30.         }
  31.     }

HTMLTagClass HTMLTagClass ([array $attributes = NULL], mixed 1)
  • mixed 1: You can have any number of parameters that will be added to the content of the tag automatically.
  • array $attributes: - Associative array of name="value" pairs of tag atributes. ie array("border"=>0, "class"=>"hover");
render (line 132)

Renders the tag, attributes, content and close tag.

  1. function render($indent_level=NULL$output_debug=0{
  2.  
  3.         //try and guess the indentation flags
  4.         //based on the data
  5.         $this->_prepare_flags();
  6.  
  7.         if $indent_level==NULL {
  8.             $indent_level 0;
  9.         }
  10.  
  11.         $html $this->_render_tag($indent_level$output_debug);
  12.  
  13.         if $this->_flags _CONTENTREQUIRED{
  14.             $html .= $this->_render_content($indent_level$output_debug);
  15.         }
  16.         if $this->_flags _CLOSETAGREQUIRED {
  17.             $html .= $this->_render_close_tag($indent_level$output_debug);
  18.         }
  19.  
  20.         return $html;
  21.     }

string render ([int $indent_level = NULL], [boolean $output_debug = 0])
  • int $indent_level: the indentation level for this tag.
  • boolean $output_debug: output in html viewable mode

Redefinition of:
XMLTagClass::render()
This function is responsible for rendering the tag and its contents
set_class (line 182)

This function is a shorthand helper to setting the class attribute on a tag.

  1. function set_class$value {
  2.         $this->set_tag_attribute("class"$value);
  3.     }

none set_class (string $value)
  • string $value: - the class value.
set_id (line 196)

This function is a shorthand helper to setting the id attribute on a tag.

  1. function set_id$value {
  2.         $this->set_tag_attribute("id"$value);
  3.     }

none set_id (string $value)
  • string $value: - the class value.
set_style (line 168)

This function is a shorthand helper to setting the style attribute on a tag.

  1. function set_style$value {
  2.         $this->set_tag_attribute("style"$value);
  3.     }

none set_style (string $value)
  • string $value: - the style value.

Inherited Methods

Inherited From XMLTagClass

XMLTagClass::XMLTagClass()
XMLTagClass::get_tag()
XMLTagClass::get_tag_attribute()
XMLTagClass::get_tag_name()
XMLTagClass::render()
XMLTagClass::reset_attributes()
XMLTagClass::set_cdata_flag()
XMLTagClass::set_collapse()
XMLTagClass::set_newline_after_closetag()
XMLTagClass::set_newline_after_opentag()
XMLTagClass::set_tag_attribute()
XMLTagClass::set_tag_attributes()
XMLTagClass::set_tag_name()
XMLTagClass::_set_flags()

Inherited From Container

Container::Container()
Container::add()
Container::add_reference()
Container::count_content()
Container::get_element()
Container::get_indent_flag()
Container::push()
Container::push_reference()
Container::render()
Container::reset_content()
Container::set_collapse()
Container::set_indent_flag()

Documentation generated on Fri, 28 Jan 2011 08:53:08 -0500 by phpDocumentor 1.4.3