Cms\Twig\DebugExtension

Source: ~/modules/cms/twig/DebugExtension.php

Extends:

  • Twig_Extension

Implements:

  • Twig_ExtensionInterface

Protected properties

protected Cms\Classes\Controller $controller

A reference to the CMS controller.

protected integer $zebra

Helper for rendering table row styles.

protected boolean $variablePrefix

If no variable is passed, true.

protected array $commentMap

Collection of method/property comments.

protected array $blockMethods

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

Public methods

public void __construct(Cms\Classes\Controller $controller)

Creates the extension instance.

Parameters

public void dump(mixed $variables=NULL, mixed $caption=NULL)

Dump information about a variable

Parameters
  • mixed $variables - Variable to dump
  • mixed $caption - Caption [and subcaption] of the dump

public array getFunctions()

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

public string runDump(Twig_Environment $env, array $context)

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

Parameters
  • Twig_Environment $env
  • array $context

Show inherited public methods

Inherited public methods

  • public void getFilters() - defined in Twig_Extension.
  • public void getNodeVisitors() - defined in Twig_Extension.
  • public void getOperators() - defined in Twig_Extension.
  • public void getTests() - defined in Twig_Extension.
  • public void getTokenParsers() - defined in Twig_Extension.

Protected methods

protected string arrayToCss(array $rules)

Convert a key/value pair array into a CSS string

Parameters
  • array $rules - List of rules to process

protected string evalArrDesc(array $variable)

Evaluate an array type for description

Parameters
  • array $variable

protected string evalDocBlock(ReflectionClass $reflectionObj)

Extracts the comment from a DocBlock

Parameters
  • ReflectionClass $reflectionObj

protected string evalKeyLabel(string $key)

Returns a variable name as HTML friendly.

Parameters
  • string $key

protected string evalMethodDesc(object $variable)

Evaluate an method type for description

Parameters
  • object $variable

protected string evalObjDesc(array $variable)

Evaluate an object type for description

Parameters
  • array $variable

protected string evalObjLabel(object $variable)

Evaluate an object type for label

Parameters
  • object $variable

protected string evalToggleDumpOnClick()

Builds JavaScript for toggling the dump container

protected string evalVarDesc(mixed $variable, $key)

Evaluate the variable description

Parameters
  • mixed $variable
  • $key

protected string evalVarDump(mixed $variable)

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

Parameters
  • mixed $variable

protected string evalVarLabel(mixed $variable)

Evaluate the variable description

Parameters
  • mixed $variable

protected string getContainerCss()

Get the CSS string for the output container

protected string getDataCss(mixed $variable)

Get the CSS string for the output data

Parameters
  • mixed $variable

protected string getHeaderCss()

Get the CSS string for the output header

protected string getSubheaderCss()

Get the CSS string for the output subheader

protected string getType(object $variable)

Evaluate an object type for label

Parameters
  • object $variable

protected string makeTableHeader(mixed $caption)

Builds the HTML used for the table header.

Parameters
  • mixed $caption - Caption [and subcaption] of the dump

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

Builds the HTML used for each table row.

Parameters
  • mixed $key
  • mixed $variable

protected array objectToArray(mixed $object)

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

Parameters
  • mixed $object

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

Returns default comment information for a paginator object.

Parameters
  • Illuminate\Pagination\Paginator $paginator