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

Class: HTML_CSS

Source Location: /HTML_CSS-1.0.0RC2/CSS.php

Class Overview

HTML_Common
   |
   --HTML_CSS

Base class for CSS definitions


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 68]
Base class for CSS definitions

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

PHP versions 4 and 5

LICENSE: This source file is subject to version 3.0 of the PHP license that is available through the world-wide-web at the following URI: http://www.php.net/license/3_0.txt. If you did not receive a copy of the PHP License and are unable to obtain it through the web, please send a note to license@php.net so we can mail you a copy immediately.



[ Top ]


Method Detail

HTML_CSS (Constructor)   [line 259]

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

Class constructor
  • Since: 0.2.0
  • Access: public

Parameters:

array   $attributes   —  (optional) Pass options to the constructor. Valid options are : xhtml (sets xhtml compliance), tab (sets indent string), filename (name of file to be parsed), cache (determines whether the nocache headers are sent), oneline (whether to output each definition on one line), groupsfirst (determines whether to output groups before elements)
array   $prefs   —  (optional) has to configure error handler
   $errorPrefs   — 

[ Top ]

addGroupSelector   [line 714]

void|PEAR_Error addGroupSelector( mixed $group, string $selectors)

Adds a selector to a CSS definition group.
  • Since: 0.3.0
  • Throws: HTML_CSS_ERROR_NO_GROUP, HTML_CSS_ERROR_INVALID_INPUT
  • Access: public

Parameters:

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

[ Top ]

apiVersion   [line 300]

string apiVersion( )

Returns the current API version Since 1.0.0 a string is returned rather than a float (for previous versions).
  • Return: compatible with php.version_compare()
  • Since: 0.2.0
  • Access: public

[ Top ]

collapseInternalSpaces   [line 465]

string collapseInternalSpaces( string $subject)

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

Parameters:

string   $subject   —  string to format

[ Top ]

createGroup   [line 505]

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

Creates a new CSS definition group. Returns an integer identifying the group.
  • See: HTML_CSS::unsetGroup()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_INVALID_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 1417]

void display( )

Outputs the stylesheet to the browser.

[ Top ]

getCharset   [line 1026]

string getCharset( )

Returns the charset encoding string

[ Top ]

getGroupStyle   [line 660]

mixed|PEAR_Error getGroupStyle( mixed $group, string $property)

Returns a CSS definition for a CSS definition group
  • See: HTML_CSS::setGroupStyle()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_NO_GROUP, HTML_CSS_ERROR_NO_ELEMENT
  • Since: 0.3.0
  • Access: public

Parameters:

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

[ Top ]

getStyle   [line 863]

mixed|PEAR_Error getStyle( string $element, string $property)

Retrieves the value of a CSS property
  • See: HTML_CSS::setStyle()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_NO_ELEMENT, HTML_CSS_ERROR_NO_ELEMENT_PROPERTY
  • Since: 0.3.0
  • Access: public

Parameters:

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

[ Top ]

isError   [line 1537]

boolean isError( )

Determine whether there is an error
  • Return: TRUE if error raised, FALSE otherwise
  • Since: 1.0.0RC2
  • Access: public

[ Top ]

parseData   [line 1180]

void|PEAR_Error parseData( array $styles, [bool $duplicates = null])

Parse data sources, file(s) or string(s), that contains CSS information

Parameters:

array   $styles   —  data sources to parse
bool   $duplicates   —  Allow or disallow duplicates.

[ Top ]

parseFile   [line 1134]

void|PEAR_Error parseFile( string $filename, [bool $duplicates = null])

Parse a file that contains CSS information
  • See: HTML_CSS::parseString()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_NO_FILE
  • Since: 0.3.0
  • Access: public

Parameters:

string   $filename   —  file to parse
bool   $duplicates   —  Allow or disallow duplicates.

[ Top ]

parseSelectors   [line 363]

mixed|PEAR_Error 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
  • Throws: HTML_CSS_ERROR_INVALID_INPUT
  • Access: protected

Parameters:

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

[ Top ]

parseString   [line 1043]

void|PEAR_Error parseString( string $str, [bool $duplicates = null])

Parse a textstring that contains css information

Parameters:

string   $str   —  text string to parse
bool   $duplicates   —  Allows or disallows duplicate style definitions

[ Top ]

raiseError   [line 1523]

object PEAR_Error raiseError( )

A basic wrapper around the default PEAR_Error object
  • Return: when default error handler is used
  • See: _errorHandler()
  • Since: 0.3.3
  • Access: public

[ Top ]

removeGroupSelector   [line 750]

void|PEAR_Error removeGroupSelector( mixed $group, string $selectors)

Removes a selector from a group.
  • Since: 0.3.0
  • Throws: HTML_CSS_ERROR_NO_GROUP, HTML_CSS_ERROR_INVALID_INPUT
  • Access: public

Parameters:

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

[ Top ]

setCache   [line 980]

void|PEAR_Error setCache( [bool $cache = true])

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

Parameters:

bool   $cache   —  (optional)

[ Top ]

setCharset   [line 1005]

void|PEAR_Error 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.

Parameters:

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

[ Top ]

setGroupStyle   [line 596]

void|int|PEAR_Error setGroupStyle( mixed $group, string $property, string $value, [bool $duplicates = null])

Sets or adds a CSS definition for a CSS definition group
  • Return: Returns an integer if duplicates are allowed.
  • See: HTML_CSS::getGroupStyle()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_NO_GROUP
  • Since: 0.3.0
  • Access: public

Parameters:

mixed   $group   —  CSS definition group identifier
string   $property   —  Property defined
string   $value   —  Value assigned
bool   $duplicates   —  Allow or disallow duplicates.

[ Top ]

setOutputGroupsFirst   [line 337]

void|PEAR_Error setOutputGroupsFirst( bool $value)

Determines whether groups are output before elements or not
  • Since: 0.3.3
  • Throws: HTML_CSS_ERROR_INVALID_INPUT
  • Access: public

Parameters:

bool   $value   — 

[ Top ]

setSameStyle   [line 929]

void|PEAR_Error setSameStyle( string $new, string $old)

Sets or changes the properties of new selectors to the values of an existing selector
  • Since: 0.2.0
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_NO_ELEMENT
  • 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 315]

void|PEAR_Error setSingleLineOutput( bool $value)

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

Parameters:

bool   $value   — 

[ Top ]

setStyle   [line 796]

void|PEAR_Error setStyle( string $element, string $property, string $value, [bool $duplicates = null])

Sets or adds a CSS definition

Parameters:

string   $element   —  Element (or class) to be defined
string   $property   —  Property defined
string   $value   —  Value assigned
bool   $duplicates   —  Allow or disallow duplicates.

[ Top ]

setXhtmlCompliance   [line 481]

void|PEAR_Error setXhtmlCompliance( bool $value)

Sets XHTML compliance
  • Since: 0.3.2
  • Throws: HTML_CSS_ERROR_INVALID_INPUT
  • Access: public

Parameters:

bool   $value   —  Boolean value

[ Top ]

toArray   [line 1220]

array toArray( )

Returns the array of CSS properties
  • Since: 0.2.0
  • Access: public

[ Top ]

toFile   [line 1300]

void|PEAR_Error toFile( $filename)

Generates CSS and stores it in a file.
  • See: HTML_CSS::toString()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_WRITE_FILE
  • Since: 0.3.0
  • Access: public

Parameters:

   $filename   — 

[ Top ]

toInline   [line 1242]

string|PEAR_Error toInline( string $element)

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

Parameters:

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

[ Top ]

toString   [line 1330]

string toString( )

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

[ Top ]

unsetGroup   [line 549]

void|PEAR_Error unsetGroup( mixed $group)

Sets or adds a CSS definition for a CSS definition group
  • See: HTML_CSS::createGroup()
  • Throws: HTML_CSS_ERROR_INVALID_INPUT, HTML_CSS_ERROR_NO_GROUP
  • Since: 0.3.0
  • Access: public

Parameters:

mixed   $group   —  CSS definition group identifier

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:31:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright Š PHP Group 2004.