Class HTMLPurifier_Generator

Description

Generates HTML from tokens.

  • todo: Refactor interface so that configuration/context is determined upon instantiation, no need for messy generateFromTokens() calls
  • todo: Make some of the more internal functions protected, and have unit tests work around that

Located in /lib/core/Parsers/htmlpurifier/HTMLPurifier.standalone.php (line 3787)


	
			
Variable Summary
mixed $config
Method Summary
HTMLPurifier_Generator __construct ($config $config, $context $context)
String escape ($string $string, [$quote $quote = null])
Generate generateAttributes ($assoc_array_of_attributes $assoc_array_of_attributes, [$element $element = false])
Generated generateFromToken ($token $token)
Generated generateFromTokens ($tokens $tokens, $config 1)
void generateScriptFromToken ( $token)
Variables
mixed $config (line 3825)

Configuration for the generator

  • access: protected
Methods
Constructor __construct (line 3831)
  • access: public
HTMLPurifier_Generator __construct ($config $config, $context $context)
  • $config $config: Instance of HTMLPurifier_Config
  • $context $context: Instance of HTMLPurifier_Context
escape (line 3997)

Escapes raw text data.

  • return: escaped data.
  • todo: This really ought to be protected, but until we have a facility for properly generating HTML here w/o using tokens, it stays public.
  • access: public
String escape ($string $string, [$quote $quote = null])
  • $string $string: String data to escape for HTML.
  • $quote $quote: Quoting style, like htmlspecialchars. ENT_NOQUOTES is permissible for non-attribute output.
generateAttributes (line 3969)

Generates attribute declarations from attribute array.

  • return: HTML fragment for insertion.
  • access: public
Generate generateAttributes ($assoc_array_of_attributes $assoc_array_of_attributes, [$element $element = false])
  • $assoc_array_of_attributes $assoc_array_of_attributes: Attribute array
  • $element $element: Name of element attributes are for, used to check attribute minimization.
generateFromToken (line 3891)

Generates HTML from a single token.

  • return: HTML
  • access: public
Generated generateFromToken ($token $token)
  • $token $token: HTMLPurifier_Token object.
generateFromTokens (line 3846)

Generates HTML from an array of tokens.

  • return: HTML
  • access: public
Generated generateFromTokens ($tokens $tokens, $config 1)
  • $config 1: HTMLPurifier_Config object
  • $tokens $tokens: Array of HTMLPurifier_Token
generateScriptFromToken (line 3954)

Special case processor for the contents of script tags

  • access: public
void generateScriptFromToken ( $token)
  • $token

Documentation generated on Sun, 06 Mar 2011 00:24:05 -0500 by phpDocumentor 1.4.3