Cms\Twig\DebugExtension

Overview

DebugExtension for Twig

Extends
  • Twig\Extension\AbstractExtension
Implements
  • Twig\Extension\ExtensionInterface

Protected Properties

protected Cms\Classes\Controller $controller

controller reference.

protected integer $zebra

zebra is a helper for rendering table row styles.

protected boolean $variablePrefix

variablePrefix is true if no variable is passed.

protected array $commentMap

commentMap of method/property comments.

protected array $blockMethods

blockMethods that should not be included in the dump.


Public Methods

public __construct()

public __construct($controller = null): void

__construct the extension instance.

public static addExtensionToTwig()

public static addExtensionToTwig($twig): void

addExtensionToTwig adds this extension to the Twig environment and ensures it cannot be used in safe mode.

public dump()

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

dump information about a variable

public dumpVars()

public dumpVars($vars = null): void

dumpVars returns dumped variables

public dumpVarsAndDie()

public dumpVarsAndDie($vars = null): void

dumpVarsAndDie outputs dumped variables and then dies

public getFunctions()

public getFunctions(): array 

getFunctions returns a list of global functions to add to the existing list.

public runDump()

public runDump(TwigEnvironment $env, array $context): string 

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

Show inherited public methods

Inherited Public Methods

  • getFilters() - (defined in Twig\Extension\AbstractExtension)
  • getNodeVisitors() - (defined in Twig\Extension\AbstractExtension)
  • getOperators() - (defined in Twig\Extension\AbstractExtension)
  • getTests() - (defined in Twig\Extension\AbstractExtension)
  • getTokenParsers() - (defined in Twig\Extension\AbstractExtension)

Protected Methods

protected arrayToCss()

protected arrayToCss(array $rules): string 

arrayToCss converts a key/value pair array into a CSS string

protected evalArrDesc()

protected evalArrDesc(array $variable): string 

evalArrDesc evaluates an array type for description

protected evalDocBlock()

protected evalDocBlock(ReflectionClass $reflectionObj): string 

evalDocBlock extracts the comment from a DocBlock

protected evalKeyLabel()

protected evalKeyLabel(string $key): string 

evalKeyLabel returns a variable name as HTML friendly.

protected evalMethodDesc()

protected evalMethodDesc(string $variable): string 

evalMethodDesc evaluates an method type for description

protected evalObjDesc()

protected evalObjDesc(array $variable): string 

evalObjDesc evaluates an object type for description

protected evalObjLabel()

protected evalObjLabel(object $variable): string 

evalObjLabel evaluates an object type for label

protected evalToggleDumpOnClick()

protected evalToggleDumpOnClick(): string 

evalToggleDumpOnClick builds JavaScript for toggling the dump container

protected evalVarDesc()

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

evalVarDesc evaluates the variable description

protected evalVarDump()

protected evalVarDump(mixed $variable): string 

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

protected evalVarLabel()

protected evalVarLabel(mixed $variable): string 

evalVarLabel evaluates the variable description

protected getContainerCss()

protected getContainerCss(): string 

getContainerCss gets the CSS string for the output container

protected getDataCss()

protected getDataCss(mixed $variable): string 

getDataCss gets the CSS string for the output data

protected getHeaderCss()

protected getHeaderCss(): string 

getHeaderCss gets the CSS string for the output header

protected getSubheaderCss()

protected getSubheaderCss(): string 

getSubheaderCss gets the CSS string for the output subheader

protected getType()

protected getType(mixed $variable): string 

getType evaluates an object type for label

protected makeTableHeader()

protected makeTableHeader(mixed $caption): string 

makeTableHeader builds the HTML used for the table header.

protected makeTableRow()

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

makeTableRow builds the HTML used for each table row.

protected objectToArray()

protected objectToArray(mixed $object): array 

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

protected paginatorToArray()

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

paginatorToArray returns default comment information for a paginator object.

protected variableToDump()

protected variableToDump($variable): void

variableToDump converts a variable to a HTML dumped version