HTML_CSS
[ class tree: HTML_CSS ] [ index: HTML_CSS ] [ all elements ]

Class: HTML_CSS

Source Location: /HTML_CSS-0.3.4/CSS.php

Class Overview

HTML_Common
   |
   --HTML_CSS

Base class for CSS definitions


Author(s):

Version:

  • 0.3.3

Methods


Inherited Variables

Inherited Methods


Class Details

[line 157]
Base class for CSS definitions

This class handles the details for creating properly constructed CSS declarations.



[ Top ]


Method Detail

HTML_CSS (Constructor)   [line 253]

HTML_CSS HTML_CSS( [array $attributes = array()], [ $errorPrefs = array()])

Class constructor
  • Since: 0.2.0
  • Access: public

Parameters:

array   $attributes   —  Pass options to the constructor. Valid options are xhtml (sets xhtml compliance), tab (sets indent string), cache (determines whether the nocache headers are sent), filename (name of file to be parsed), oneline (bool, whether to output each definition on one line)
   $errorPrefs   — 

[ Top ]

addGroupSelector   [line 520]

int addGroupSelector( int $group, string $selectors)

Adds a selector to a CSS definition group.
  • Since: 0.3.0
  • Access: public

Parameters:

int   $group   —  CSS definition group identifier
string   $selectors   —  Selector(s) to be defined, comma delimited.

[ Top ]

apiVersion   [line 289]

double apiVersion( )

Returns the current API version
  • Since: 0.2.0
  • Access: public

[ Top ]

collapseInternalSpaces   [line 397]

string collapseInternalSpaces( $subject)

Strips excess spaces in string.
  • Since: 0.3.2
  • Access: public

Parameters:

   $subject   — 

[ Top ]

createGroup   [line 430]

int createGroup( string $selectors, [mixed $identifier = null])

Creates a new CSS definition group. Returns an integer identifying the group.
  • Since: 0.3.0
  • Access: public

Parameters:

string   $selectors   —  Selector(s) to be defined, comma delimited.
mixed   $identifier   —  Group identifier. If not passed, will return an automatically assigned integer.

[ Top ]

display   [line 962]

void display( )

Outputs the stylesheet to the browser.
  • Since: 0.2.0
  • Access: public

[ Top ]

getCharset   [line 671]

void getCharset( )

Returns the charset encoding string
  • Since: 0.2.0
  • Access: public

[ Top ]

getGroupStyle   [line 502]

string getGroupStyle( int $group, string $property)

Returns a CSS definition for a CSS definition group
  • Since: 0.3.0
  • Access: public

Parameters:

int   $group   —  CSS definition group identifier
string   $property   —  Property defined

[ Top ]

getStyle   [line 582]

void getStyle( string $element, string $property)

Retrieves the value of a CSS property
  • Since: 0.3.0
  • Access: public

Parameters:

string   $element   —  Element (or class) to be defined
string   $property   —  Property defined

[ Top ]

parseFile   [line 750]

void parseFile( string $filename)

Parse a file that contains CSS information
  • Since: 0.3.0
  • Access: public

Parameters:

string   $filename   —  file to parse

[ Top ]

parseSelectors   [line 319]

mixed parseSelectors( string $selectors, [int $outputMode = 0])

Parses a string containing selector(s).

It processes it and returns an array or string containing modified selectors (depends on XHTML compliance setting; defaults to ensure lowercase element names)

  • Since: 0.3.2
  • Access: public

Parameters:

string   $selectors   —  Selector string
int   $outputMode   — 
  1. = string; 1 = array; 3 = deep array

[ Top ]

parseString   [line 684]

void parseString( string $str)

Parse a textstring that contains css information
  • Since: 0.3.0
  • Access: public

Parameters:

string   $str   —  text string to parse

[ Top ]

raiseError   [line 1126]

array raiseError( integer $code, string $level, array $params, array $trace)

Add an error to the stack Dies if the error is an exception (and would have died anyway)
  • Return: PEAR_ErrorStack instance. And with context info (if PHP 4.3+)
  • Since: 0.3.3
  • Access: public

Parameters:

integer   $code   —  Error code.
string   $level   —  The error level of the message. Valid are PEAR_LOG_* constants
array   $params   —  Associative array of error parameters
array   $trace   —  Error context info (see debug_backtrace() contents)

[ Top ]

removeGroupSelector   [line 542]

int removeGroupSelector( int $group, string $selectors)

Removes a selector from a group.
  • Since: 0.3.0
  • Access: public

Parameters:

int   $group   —  CSS definition group identifier
string   $selectors   —  Selector(s) to be removed, comma delimited.

[ Top ]

setCache   [line 643]

void setCache( [string $cache = 'true'])

Defines if the document should be cached by the browser. Defaults to false.
  • Since: 0.2.0
  • Access: public

Parameters:

string   $cache   —  Options are currently 'true' or 'false'. Defaults to 'true'.

[ Top ]

setCharset   [line 660]

void setCharset( [string $type = 'iso-8859-1'])

Defines the charset for the file. defaults to ISO-8859-1 because of CSS1 compatability issue for older browsers.
  • Since: 0.2.0
  • Access: public

Parameters:

string   $type   —  Charset encoding; defaults to ISO-8859-1.

[ Top ]

setGroupStyle   [line 484]

void setGroupStyle( int $group, string $property, string $value)

Sets or adds a CSS definition for a CSS definition group
  • Since: 0.3.0
  • Access: public

Parameters:

int   $group   —  CSS definition group identifier
string   $property   —  Property defined
string   $value   —  Value assigned

[ Top ]

setSameStyle   [line 620]

void setSameStyle( string $new, string $old)

Sets or changes the properties of new selectors to the values of an existing selector
  • Since: 0.2.0
  • Access: public

Parameters:

string   $old   —  Selector that is already defined
string   $new   —  New selector(s) that should share the same definitions, separated by commas

[ Top ]

setSingleLineOutput   [line 302]

void setSingleLineOutput( bool $value)

Determines whether definitions are output single line or multiline
  • Since: 0.3.3
  • Access: public

Parameters:

bool   $value   — 

[ Top ]

setStyle   [line 568]

void setStyle( string $element, string $property, string $value)

Sets or adds a CSS definition
  • Since: 0.2.0
  • Access: public

Parameters:

string   $element   —  Element (or class) to be defined
string   $property   —  Property defined
string   $value   —  Value assigned

[ Top ]

setXhtmlCompliance   [line 409]

void setXhtmlCompliance( bool $value)

Sets or adds a CSS definition for a CSS definition group
  • Since: 0.3.2
  • Access: public

Parameters:

bool   $value   —  Boolean value

[ Top ]

toArray   [line 773]

array toArray( )

Generates and returns the array of CSS properties
  • Since: 0.2.0
  • Access: public

[ Top ]

toFile   [line 859]

void toFile( $filename)

Generates CSS and stores it in a file.
  • Since: 0.3.0
  • Access: public

Parameters:

   $filename   — 

[ Top ]

toInline   [line 818]

string toInline( string $element)

Generates and returns the CSS properties of an element or class as a string for inline use.
  • Since: 0.2.0
  • Access: public

Parameters:

string   $element   —  Element or class for which inline CSS should be generated

[ Top ]

toString   [line 882]

string toString( )

Generates and returns the complete CSS as a string.
  • Since: 0.2.0
  • Access: public

[ Top ]

unsetGroup   [line 459]

void unsetGroup( int $group)

Sets or adds a CSS definition for a CSS definition group
  • Since: 0.3.0
  • Access: public

Parameters:

int   $group   —  CSS definition group identifier

[ Top ]


Documentation generated on Mon, 11 Mar 2019 10:16:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.