Pelago\Emogrifier

This class provides functions for converting CSS styles into inline style attributes in your HTML code.

For more information, please see the README.md file.

Synopsis

class Emogrifier {
  • // constants
  • const ENCODING = 'UTF-8';
  • const CACHE_KEY_CSS = 0;
  • const CACHE_KEY_SELECTOR = 1;
  • const CACHE_KEY_XPATH = 2;
  • const CACHE_KEY_CSS_DECLARATION_BLOCK = 3;
  • const INDEX = 0;
  • const MULTIPLIER = 1;
  • const ID_ATTRIBUTE_MATCHER = '/(\\w+)?\\#([\\w\\-]+)/';
  • const CLASS_ATTRIBUTE_MATCHER = '/(\\w+|[\\*\\]])?((\\.[\\w\\-]+)+)/';
}

Constants

Name Value
ENCODING 'UTF-8'
CACHE_KEY_CSS 0
CACHE_KEY_SELECTOR 1
CACHE_KEY_XPATH 2
CACHE_KEY_CSS_DECLARATION_BLOCK 3
INDEX 0
MULTIPLIER 1
ID_ATTRIBUTE_MATCHER '/(\\w+)?\\#([\\w\\-]+)/'
CLASS_ATTRIBUTE_MATCHER '/(\\w+|[\\*\\]])?((\\.[\\w\\-]+)+)/'

Members

private

public

  • $preserveEncoding — boolean
    This attribute applies to the case where you want to preserve your original text encoding.

Methods

private

public