Class document

document
Direct Known Subclasses:
gui

public class document

Document class.
Helps rendering basic HTML content, like document definition, header and metas.

Note: This class does not use tag_writer (it's useless until <body>, which is not rendered by this class)


Constructor Summary
document(var $charset)
          Set up the default values.
 
Method Summary
 unknown _array_print(var $arr, var $format)
          Output an array.
 unknown _default_metas()
          Extension for subclasses.
 unknown author(var $who)
          Adds "author" meta to doc's meta tags.
 unknown begin()
          Generate document header.
 unknown created(var $when)
          Adds "created" meta to doc's meta tags.
 unknown end()
          Generate end of the document.
 unknown keywords(var $words)
          Adds "keywords" meta to doc's meta tags.
 unknown meta(var $name, var $content, var $type, var $echo)
          Create META tag.
 unknown script(var $fn)
          Add a script file to document header.
 unknown style(var $fn, var $alternate, var $alt_title)
          Add a style file to document header.
 

Constructor Detail

document

public document(var $charset)
Set up the default values.
Parameters:
$charset - Character set to use with content meta tag.
$charset - Default Value: "iso-8859-1"
Method Detail

_array_print

public unknown _array_print(var $arr,
                            var $format)
Output an array. Note: internal array counter of $arr will be changed
Parameters:
$arr - General array you want to print.
$format - Format specification: "%key%" in $line will be replaced by key name, "%value%" by key value

_default_metas

public unknown _default_metas()
Extension for subclasses.

meta

public unknown meta(var $name,
                    var $content,
                    var $type,
                    var $echo)
Create META tag.
Parameters:
$name - meta name
$content - meta content
$type - meta type (http-equiv | name | null=name)
$echo - directly print the meta
$type - Default Value: null
$echo - Default Value: true

created

public unknown created(var $when)
Adds "created" meta to doc's meta tags.
Parameters:
$when - date of doc creation.

author

public unknown author(var $who)
Adds "author" meta to doc's meta tags.
Parameters:
$who - author string

keywords

public unknown keywords(var $words)
Adds "keywords" meta to doc's meta tags.
Parameters:
$words - keywords (csv)

style

public unknown style(var $fn,
                     var $alternate,
                     var $alt_title)
Add a style file to document header.
Parameters:
$fn - filename (url) to include
$alternate - if true, style is made alternate style
$alt_title - title of alternate
$alternate - Default Value: false
$alt_title - Default Value: null

script

public unknown script(var $fn)
Add a script file to document header. * @param $fn filename (url) to include

begin

public unknown begin()
Generate document header.

end

public unknown end()
Generate end of the document.