Class HTMLPageClass

Description

class the constructs and renders an entire HTML/XHTML document.

Located in /widgets/HTMLPageClass.inc (line 26)


	
			
Direct descendents
Class Description
HTMLRedirectPage This builds an entire HTML Page with the sole purpose of doing a redirect to another url.
PageWidget This class is used to build content for an entire page. It uses the HTMLPageClass widget from phphtmllib to render the final output.
Variable Summary
Method Summary
HTMLPageClass HTMLPageClass ([mixed $title = NULL], [string $html_type = HTML], [int $indent_style = INDENT_NICE])
void add (mixed 0)
void add_css_link (mixed $link, [string $media = FALSE])
void add_head_content (mixed 0)
void add_head_css (string $css)
void add_head_js (mixed $content)
void add_js_link (mixed $link)
void add_reference (mixed &$content)
void build_doctype (string $link1, [string $link2 = NULL])
array(); get_html_attributes ()
void push ()
void push_css_link (mixed $link)
void push_head_js (mixed $content)
void push_js_link (mixed $link)
void push_reference (mixed &$content)
string render ()
void set_body_attributes (array $attributes)
void set_charset (string $charset)
void set_encoding (string $encoding)
void set_favicon (string $path, [string $type = "image/x-ico"])
void set_favicon_flag ([boolean $flag = TRUE])
void set_frameset (FRAMESETtag $frameset)
void set_html_attributes (array $attributes)
void set_language (string $language)
void set_refresh (int $time, [string $url = NULL])
void set_text_debug ($flag $flag)
void set_title (mixed $title)
void _build_head ()
void _create_body ()
Variables
array $_favicon = array("href" => "/favicon.ico",
"type" => "images/x-ico",
"enabled" => FALSE)
(line 171)

The favicon params

array $_html_attributes = array() (line 131)

This holds the attributes for the <html> tag.

string $_html_render_type = HTML (line 165)

keeps track of the html render type.

int $_indent_style = 0 (line 157)

Holds the value of the indent style the user wants to render the page w/

array $_widget_css_auto = array() (line 139)

keeps track of which widgets we have automatically pulled in css for

array $_widget_js_auto = array() (line 147)

keeps track of which widgets we have automatically pulled in js for

mixed $_xml_encoding = "UTF-8" (line 75)

The encoding of the XHTML

XML tag

Methods
Constructor HTMLPageClass (line 201)

Class Constructor

  • access: public
HTMLPageClass HTMLPageClass ([mixed $title = NULL], [string $html_type = HTML], [int $indent_style = INDENT_NICE])
  • mixed $title: - $title Title string or TITLEtag object for the page.
  • string $html_type: - one of 3 types of html to render. Setting this will make the object declare the gobal define which tells all of the tag objects what type of html tags to render. some tags support special features. such as the <IMG> tag. If xhtml is selected, the the IMGtag object and all utility functions will not render "border=0" as a default attribute, since this is not proper xhtml. "html" - HTML 4.0 (default) "xhtml_transitional" - render xhtml instead of html
    • doctype is XHTML transitional.
    "xhtml_strict" - render xhtml instead of html 4.0.
    • doctype is XHTML strict.
  • int $indent_style: - one of 2 types. INDENT_NICE or INDENT_LEFT_JUSTIFY This tells the page how to render the indenting of the output. By default it is set to INDENT_NICE, which nicely indents each nested tag. You can have all tags rendered left justified (smaller size in output) by using INDENT_LEFT_JUSTIFY
add (line 509)

This function adds content to the <body> area of the page.

void add (mixed 0)
  • mixed 0: - any # of parameters
add_css_link (line 333)

pushes a css external reference to the head area

void add_css_link (mixed $link, [string $media = FALSE])
  • mixed $link: - link tag object or $url for a css.
  • string $media: the media attribute (if any)
add_head_content (line 261)

this adds content to the head tag of the page

void add_head_content (mixed 0)
  • mixed 0: - any content to add
add_head_css (line 305)

this function adds raw css to the <head> tag. It will automatically be wrapped in a <style type="text/css">

void add_head_css (string $css)
  • string $css: - the raw css
add_head_js (line 285)

adds raw javascript to the head which will automatically get wrapped in a <script language="JavaScript"> tag.

void add_head_js (mixed $content)
  • mixed $content: - raw javascript code to add to the head
add_js_link (line 361)

This adds a link to an external Javascript file, which will get rendered in the head.

void add_js_link (mixed $link)
  • mixed $link: - script tag object or $url of .js file.
add_reference (line 546)

Adds the content reference to the <body> tag for later use.

void add_reference (mixed &$content)
  • mixed $content: - content to add
build_doctype (line 595)

This function is used to build the DOCTYPE

tag for the page. It will automatically create a DOCTYPE with a document_element of "html" and a source of "PUBLIC"

void build_doctype (string $link1, [string $link2 = NULL])
  • string $link1: - link1
  • string $link2: - link2
get_html_attributes (line 445)

This function returns the attributes to be used for the <html> tag.

array(); get_html_attributes ()
push (line 535)

Same as add()

  • deprecated: - use add()
void push ()
push_css_link (line 350)

Same ass add_css_link()

  • deprecated: - use add_css_link();
void push_css_link (mixed $link)
push_head_content (line 273)

Same ass add_head_content()

  • deprecated: - use add_head_content();
void push_head_content ()
push_head_js (line 294)

Same ass add_head_js()

  • deprecated: - use add_head_js();
void push_head_js (mixed $content)
push_js_link (line 375)

same as add_js_link()

  • deprecated:
void push_js_link (mixed $link)
push_reference (line 556)

Same as add()

  • deprecated: - use add()
void push_reference (mixed &$content)
render (line 662)

render the page.

  • return: the raw html output.
string render ()

Redefined in descendants as:
set_body_attributes (line 579)

set attributes of body tag

void set_body_attributes (array $attributes)
  • array $attributes: the name=>value pairs
set_charset (line 396)

set the character set

void set_charset (string $charset)
  • string $charset: - the charset for the meta tag
set_encoding (line 406)

This sets the encoding type for XHTML documents

void set_encoding (string $encoding)
  • string $encoding: - the encoding parameter
set_favicon (line 492)

This allows you to change the default url/path for where the favicon.ico lives.

NOTE: calling this method automatically enables the link in the head to be created.

void set_favicon (string $path, [string $type = "image/x-ico"])
  • string $path: the url to the favicon.ico file
  • string $type: the type of the image. NOTE: Default is image/x-ico
set_favicon_flag (line 478)

This is used to enable the ability to add the favicon link in the head of the document.

By default it is off.

void set_favicon_flag ([boolean $flag = TRUE])
  • boolean $flag: TRUE = enable
set_frameset (line 429)

This function is used to set the FRAMSETtag object for this page. This automatically sets the output for this page object to be a frameset.

void set_frameset (FRAMESETtag $frameset)
set_html_attributes (line 457)

This function sets the attributes for the <html> tag

void set_html_attributes (array $attributes)
  • array $attributes: - the name=>value pair for the attributes
set_language (line 416)

This method sets the lang, and xml:lang setting in the HTML tag.

void set_language (string $language)
  • string $language: - the language
set_refresh (line 384)

Automatically set a page meta tag refresh

void set_refresh (int $time, [string $url = NULL])
  • int $time: - time in seconds to refresh
  • string $url: - the url to go to.
set_text_debug (line 607)

set the $_text_debug flag

void set_text_debug ($flag $flag)
  • $flag $flag: - boolean.
set_title (line 315)

set the title of the page output.

void set_title (mixed $title)
  • mixed $title: - the title of the html page can be TITLEtag object.
_build_content_type_tag (line 466)

this builds the content type meta tag.

void _build_content_type_tag ()
_build_head (line 620)

builds the head object and its content.

void _build_head ()
_create_body (line 567)

This is responsible for creating the BODYtag object. We only will create a new $this->_body if it doesn't already exist.

void _create_body ()
_frameset_wrap_body (line 648)

This builds a frameset body tag wrapped in a <noframes> tag.

  • return: object.
NOFRAMEStag _frameset_wrap_body ()

Documentation generated on Thu, 1 Sep 2005 17:06:02 -0700 by phpDocumentor 1.3.0RC3