Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
HTMLPurifier_Printer Class Reference
Inheritance diagram for HTMLPurifier_Printer:
HTMLPurifier_Printer_CSSDefinition HTMLPurifier_Printer_ConfigForm HTMLPurifier_Printer_ConfigForm_NullDecorator HTMLPurifier_Printer_ConfigForm_bool HTMLPurifier_Printer_ConfigForm_default HTMLPurifier_Printer_HTMLDefinition

Public Member Functions

 __construct ()
 Initialize $generator.
 
 prepareGenerator ($config)
 Give generator necessary configuration if possible.
 

Protected Member Functions

 element ($tag, $contents, $attr=array(), $escape=true)
 Prints a complete element with content inside.
 
 elementEmpty ($tag, $attr=array())
 
 end ($tag)
 Returns an end tag.
 
 escape ($string)
 Escapes a string for HTML output.
 
 getClass ($obj, $sec_prefix='')
 Retrieves the class of an object without prefixes, as well as metadata.
 
 listify ($array, $polite=false)
 Takes a list of strings and turns them into a single list.
 
 row ($name, $value)
 Prints a simple key/value row in a table.
 
 start ($tag, $attr=array())
 Main function that renders object or aspect of that object.
 
 text ($text)
 

Protected Attributes

 $config
 For easy access.
 
 $generator
 

Member Function Documentation

◆ element()

HTMLPurifier_Printer::element ( $tag,
$contents,
$attr = array(),
$escape = true )
protected

Prints a complete element with content inside.

Parameters
string$tagTag name
string$contentsElement contents
array$attrTag attributes
bool$escapewhether or not to escape contents
Return values
string

◆ elementEmpty()

HTMLPurifier_Printer::elementEmpty ( $tag,
$attr = array() )
protected
Parameters
string$tag
array$attr
Return values
string

◆ end()

HTMLPurifier_Printer::end ( $tag)
protected

Returns an end tag.

Parameters
string$tagTag name
Return values
string

◆ escape()

HTMLPurifier_Printer::escape ( $string)
protected

Escapes a string for HTML output.

Parameters
string$stringString to escape
Return values
string

◆ getClass()

HTMLPurifier_Printer::getClass ( $obj,
$sec_prefix = '' )
protected

Retrieves the class of an object without prefixes, as well as metadata.

Parameters
object$objObject to determine class of
string$sec_prefixFurther prefix to remove
Return values
string

◆ listify()

HTMLPurifier_Printer::listify ( $array,
$polite = false )
protected

Takes a list of strings and turns them into a single list.

Parameters
string[]$arrayList of strings
bool$politeBool whether or not to add an end before the last
Return values
string

◆ prepareGenerator()

HTMLPurifier_Printer::prepareGenerator ( $config)

Give generator necessary configuration if possible.

Parameters
HTMLPurifier_Config$config

◆ row()

HTMLPurifier_Printer::row ( $name,
$value )
protected

Prints a simple key/value row in a table.

Parameters
string$nameKey
mixed$valueValue
Return values
string

◆ start()

HTMLPurifier_Printer::start ( $tag,
$attr = array() )
protected

Main function that renders object or aspect of that object.

Note
Parameters vary depending on printer Returns a start tag
Parameters
string$tagTag name
array$attrAttribute array
Return values
string

◆ text()

HTMLPurifier_Printer::text ( $text)
protected
Parameters
string$text
Return values
string

Member Data Documentation

◆ $config

HTMLPurifier_Printer::$config
protected

For easy access.

@type HTMLPurifier_Config


The documentation for this class was generated from the following file: