PEAR logo

HTML_CSS : The Definitive Guide



Chapter 8. API - Application Programming Interface

Table of Contents

Initialize parser/writer options
Handle selector and property values
Grouping selectors
Parsing data sources
Output
Searching for selectors and/or properties

Initialize parser/writer options

constructor HTML_CSS::HTML_CSS - Class constructor
HTML_CSS::setXhtmlCompliance - Sets XHTML compliance
HTML_CSS::parseFile - Parse a file that contains CSS information
HTML_CSS::setCache - Defines if the document should be cached by the browser. Defaults to false.
HTML_CSS::setSingleLineOutput - Determines whether definitions are output single line or multiline
HTML_CSS::setOutputGroupsFirst - Determines whether groups are output before elements or not

With the class constructor, you have ability to set many options :

  • xhtml option defines whether element selectors should be automatically lowercased. See also: HTML_CSS::setXhtmlCompliance().
  • tab option defines the string used to indent CSS text. See also: HTML_Common::setTab().
  • filename option allow to parse an external css file. See also: HTML_CSS::parseFile().
  • cache option controls caching of the page. See also: HTML_CSS::setCache().
  • oneline option defines whether to output all properties on one line. See also: HTML_CSS::setSingleLineOutput().
  • groupsfirst option determines whether to output groups before elements. See also: HTML_CSS::setOutputGroupsFirst().
  • allowduplicates option allow to have duplicate rules in selector.
HTML_CSS : The Definitive Guide v 1.1.3 : February 18, 2007