Class head

Description

The head class.

The class is a special kind of page section. It contains all of the meta tags, style tags, title and other such things for the webpage. Note that this section is not just the head content, but really comprises everything which is prior to the /head tag. This might include the DTD specifier for instance.

Located in /webpage-defs.php (line 1017)

RenderableObject
   |
   --page_section
      |
      --head
Variable Summary
 mixed $charset
 mixed $DTD
 mixed $languages
 mixed $meta
 mixed $style
 mixed $stylesheet
 mixed $title
Method Summary
 head head ([string $title = ""], [string $style = ""])
 void add_language (integer $langid)
 void add_style (string $style)
 string html ()
 void insert_metatag (string $id, object $metatag)
 void load_template ([string $templatefile = ""])
 void set_charset (string $charset)
 void set_dtd (string $DTD)
 void set_metatag (string $name, string $content, [string $language = ""], [string $scheme = ""])
 void set_style (string $style)
 void set_stylesheet (string $ss, [string $ss_ie = ""], [mixed $ss_ns = ""])
 void set_title (string $title)
 string wml ()
Variables
mixed $charset = "ISO-8859-1" (line 1035)

Charset for content of the page

mixed $DTD = "" (line 1023)

The Document Type Definition for this head section

mixed $languages = array() (line 1033)

Languages used in content of the page

mixed $meta (line 1025)

Meta tags array

mixed $style = "" (line 1021)

Style settings for the webpage

mixed $stylesheet = "" (line 1027)

Name of the stylesheet associated with the webpage

mixed $stylesheet_ie = "" (line 1029)

Name of the IE stylesheet

mixed $stylesheet_ns = "" (line 1031)

Name of the Netscape stylesheet

mixed $title = "" (line 1019)

Title of the webpage

Inherited Variables

Inherited from page_section

page_section::$content
page_section::$script
page_section::$scriptsrc
Methods
Constructor head (line 1043)

Constructor Create a new head object.

head head ([string $title = ""], [string $style = ""])
  • string $title: Title of the webpage
  • string $style: Specific style settings for the webpage
add_language (line 1133)

Adds another language for the current head. Webpages might contain content in multiple languages, hence the need for a list.

void add_language (integer $langid)
  • integer $langid: The new language ID to add for the webpage
add_style (line 1072)

Add the given content to the current style. Appends style statements to the style string, which is rendered when the page gets rendered.

void add_style (string $style)
  • string $style: Style settings to add to existing ones.
html (line 1193)

This renders the head as HTML. After the title and the meta tags

are rendered, the stylesheets are next. For the stylesheets we first render the standard links, and then overlay this with the Internet Explorer stylesheet if it is defined. Finally any literal styles are rendered so they will take precedence. The scripts are rendered after the styles, and the head content comes last.

string html ()

Redefinition of:
page_section::html()
This renders the page section as HTML.
insert_metatag (line 1094)

Insert a ready-made meta tag object into the metatags array.

void insert_metatag (string $id, object $metatag)
  • string $id: Meta tag unique ID
  • object $metatag: Meta tag object to insert
load_template (line 1153)

Load given template content.

We scrape everything between the appropriate tags and use it as the template for our content.

void load_template ([string $templatefile = ""])
  • string $templatefile: The full path to the template file
set_charset (line 1143)

Set the charset for this head section

void set_charset (string $charset)
  • string $charset: The charset code for content of this head section
set_dtd (line 1124)

Set the DTD specifier string for this head section.

void set_dtd (string $DTD)
  • string $DTD: The Document Type Definition string for this head
set_metatag (line 1105)

Add meta tag to the section

void set_metatag (string $name, string $content, [string $language = ""], [string $scheme = ""])
  • string $name: Meta tag name
  • string $content: Meta tag content
  • string $language: Optional language specifier for content
  • string $scheme: Optional scheme specifier for content
set_style (line 1063)

Define the style NB: The way this is currently done, you are expected to supply your style WITHOUT style tags here.

void set_style (string $style)
  • string $style: Specific style settings for the webpage
set_stylesheet (line 1083)

Set the stylesheet to use. This should be a valid pathname to an existing file. The second parm is for special styles for Internet Explorer-compatible browsers.

void set_stylesheet (string $ss, [string $ss_ie = ""], [mixed $ss_ns = ""])
  • string $ss: Path to normal stylesheet
  • string $ss_ie: Path to stylesheet for Internet Explorer
set_title (line 1053)

Define the title

void set_title (string $title)
  • string $title: Title of the webpage
wml (line 1287)

Use render() to render this element in your page.

This renders the field as WML.

string wml ()

Redefinition of:
page_section::wml()
This renders the page section as WML.

Inherited Methods

Inherited From page_section

 page_section::page_section()
 page_section::add()
 page_section::add_named_script()
 page_section::add_popup_script()
 page_section::add_script()
 page_section::add_scriptsrc()
 page_section::clear()
 page_section::get_template()
 page_section::get_trimcontent()
 page_section::html()
 page_section::replace()
 page_section::script()
 page_section::wml()

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3