Class Stylesheet

Description

The master stylesheet class

The Stylesheet class is responsible for parsing stylesheets and style tags/attributes. It also acts as a registry of the individual Style objects generated by the current set of loaded CSS files and style elements.

Located in /include/stylesheet.cls.php (line 59)


	
			
Class Constant Summary
 DEFAULT_STYLESHEET = __DEFAULT_STYLESHEET
Variable Summary
Method Summary
Stylesheet __construct ()
void add_style (string $key, Style $style)
void apply_styles (Frame_Tree $tree)
void load_css (string &$css)
void load_css_file (string $file)
Style lookup (string $key)
string __toString ()
Variables
mixed $ACCEPTED_MEDIA_TYPES = array("all", "static", "visual",
"bitmap", "paged", "print")
(line 123)

accepted CSS media types

  • static:
Methods
Constructor __construct (line 132)

The class constructor.

The base protocol, host & path are initialized to those of the current script.

Stylesheet __construct ()
add_style (line 149)

add a new Style object to the stylesheet

add_style() adds a new Style object to the current stylesheet, or merges a new Style with an existing one.

void add_style (string $key, Style $style)
  • string $key: the Style's selector
  • Style $style: the Style to be added
apply_styles (line 460)

applies all current styles to a particular document tree

apply_styles() applies all currently loaded styles to the provided Frame_Tree. Aside from parsing CSS, this is the main purpose of this class.

void apply_styles (Frame_Tree $tree)
create_style (line 181)

create a new Style object associated with this stylesheet

Style create_style ()
load_css (line 191)

load and parse a CSS string

void load_css (string &$css)
  • string $css
load_css_file (line 199)

load and parse a CSS file

void load_css_file (string $file)
  • string $file
lookup (line 169)

lookup a specifc Style object

lookup() returns the Style specified by $key, or null if the Style is not found.

Style lookup (string $key)
  • string $key: the selector of the requested Style
__toString (line 772)

dumps the entire stylesheet as a string

Generates a string of each selector and associated style in the Stylesheet. Useful for debugging.

string __toString ()
Class Constants
DEFAULT_STYLESHEET = __DEFAULT_STYLESHEET (line 67)

the location of the default built-in CSS file.

Documentation generated on Fri, 04 Mar 2005 13:31:20 -0700 by phpDocumentor 1.3.0RC3