Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

File Size: 218 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier_Printer:: (11 methods):
  __construct()
  prepareGenerator()
  start()
  end()
  element()
  elementEmpty()
  text()
  row()
  escape()
  listify()
  getClass()


Class: HTMLPurifier_Printer  - X-Ref

__construct()   X-Ref
Initialize $generator.


prepareGenerator($config)   X-Ref
Give generator necessary configuration if possible

param: HTMLPurifier_Config $config

start($tag, $attr = array()   X-Ref
Returns a start tag

param: string $tag Tag name
param: array $attr Attribute array
return: string

end($tag)   X-Ref
Returns an end tag

param: string $tag Tag name
return: string

element($tag, $contents, $attr = array()   X-Ref
Prints a complete element with content inside

param: string $tag Tag name
param: string $contents Element contents
param: array $attr Tag attributes
param: bool $escape whether or not to escape contents
return: string

elementEmpty($tag, $attr = array()   X-Ref

param: string $tag
param: array $attr
return: string

text($text)   X-Ref

param: string $text
return: string

row($name, $value)   X-Ref
Prints a simple key/value row in a table.

param: string $name Key
param: mixed $value Value
return: string

escape($string)   X-Ref
Escapes a string for HTML output.

param: string $string String to escape
return: string

listify($array, $polite = false)   X-Ref
Takes a list of strings and turns them into a single list

param: string[] $array List of strings
param: bool $polite Bool whether or not to add an end before the last
return: string

getClass($obj, $sec_prefix = '')   X-Ref
Retrieves the class of an object without prefixes, as well as metadata

param: object $obj Object to determine class of
param: string $sec_prefix Further prefix to remove
return: string