DebugExtension

 class Cms\Twig\DebugExtension
extends Twig\Extension\AbstractExtension

Extends

Constants

Constant Description
ARRAY_CAPTION
string "Array variables"
COMPONENT_CAPTION
string "Component variables"
OBJECT_CAPTION
string "Object variables"
PAGE_CAPTION
string "Page variables"

Properties

protected $blockMethods : array

Blocked object methods that should not be included in the dump.

protected $commentMap : array

Collection of method/property comments.

protected $variablePrefix : bool

If no variable is passed, true.

protected $zebra : int

Helper for rendering table row styles.

Methods

public dump (mixed $variables = null, mixed $caption = null) : void

Dump information about a variable

Parameters
Property Description
$variables
mixed

Variable to dump

$caption
mixed

Caption [and subcaption] of the dump

Returns
void

public getFunctions () : array

Returns a list of global functions to add to the existing list.

Returns
array

An array of global functions

public runDump (Twig\Environment $env, array $context) : string

Processes the dump variables, if none is supplied, all the twig template variables are used

Parameters
Property Description
$env
Twig\Environment
$context
array
Returns
string

protected arrayToCss (array $rules) : string

Convert a key/value pair array into a CSS string

Parameters
Property Description
$rules
array

List of rules to process

Returns
string

protected evalArrDesc (array $variable) : string

Evaluate an array type for description

Parameters
Property Description
$variable
array
Returns
string

protected evalDocBlock (ReflectionClass $reflectionObj) : string

Extracts the comment from a DocBlock

Parameters
Property Description
$reflectionObj
ReflectionClass
Returns
string

protected evalKeyLabel (string $key) : string

Returns a variable name as HTML friendly.

Parameters
Property Description
$key
string
Returns
string

protected evalMethodDesc (object $variable) : string

Evaluate an method type for description

Parameters
Property Description
$variable
object
Returns
string

protected evalObjDesc (array $variable) : string

Evaluate an object type for description

Parameters
Property Description
$variable
array
Returns
string

protected evalObjLabel (object $variable) : string

Evaluate an object type for label

Parameters
Property Description
$variable
object
Returns
string

protected evalToggleDumpOnClick () : string

Builds JavaScript for toggling the dump container

Returns
string

protected evalVarDesc (mixed $variable, $key) : string

Evaluate the variable description

Parameters
Property Description
$variable
mixed
$key
mixed
Returns
string

protected evalVarDump (mixed $variable) : string

Dumps a variable using HTML Dumper, wrapped in a hidden DIV element.

Parameters
Property Description
$variable
mixed
Returns
string

protected evalVarLabel (mixed $variable) : string

Evaluate the variable description

Parameters
Property Description
$variable
mixed
Returns
string

protected getContainerCss () : string

Get the CSS string for the output container

Returns
string

protected getDataCss (mixed $variable) : string

Get the CSS string for the output data

Parameters
Property Description
$variable
mixed
Returns
string

protected getHeaderCss () : string

Get the CSS string for the output header

Returns
string

protected getSubheaderCss () : string

Get the CSS string for the output subheader

Returns
string

protected getType (object $variable) : string

Evaluate an object type for label

Parameters
Property Description
$variable
object
Returns
string

protected makeTableHeader (mixed $caption) : string

Builds the HTML used for the table header.

Parameters
Property Description
$caption
mixed

Caption [and subcaption] of the dump

Returns
string

protected makeTableRow (mixed $key, mixed $variable) : string

Builds the HTML used for each table row.

Parameters
Property Description
$key
mixed
$variable
mixed
Returns
string

protected objectToArray (mixed $object) : array

Returns a map of an object as an array, containing methods and properties.

Parameters
Property Description
$object
mixed
Returns
array

protected paginatorToArray (Illuminate\Pagination\Paginator $paginator) : array

Returns default comment information for a paginator object.

Parameters
Property Description
$paginator
Illuminate\Pagination\Paginator
Returns
array
Copyright © 2024 Winter CMS