PHP Class Whoops\Util\TemplateHelper

Datei anzeigen Open project: filp/whoops Class Usage Examples

Public Methods

Method Description
breakOnDelimiter ( string $delimiter, string $s ) : string Makes sure that the given string breaks on the delimiter.
delVariable ( string $variableName ) Unsets a single template variable, by its name
dump ( mixed $value ) : string Format the given value into a human readable string.
dumpArgs ( Whoops\Exception\Frame $frame ) : string Format the args of the given Frame as a human readable html string
escape ( string $raw ) : string Escapes a string for output in an HTML document
escapeButPreserveUris ( string $raw ) : string Escapes a string for output in an HTML document, but preserves URIs within it, and converts them to clickable anchor elements.
getCloner ( ) : AbstractCloner Get the cloner used for dumping variables.
getVariable ( string $variableName, mixed $defaultValue = null ) : mixed Gets a single template variable, by its name, or $defaultValue if the variable does not exist
getVariables ( ) : array Returns all variables for this helper
render ( string $template, array $additionalVariables = null ) Given a template path, render it within its own scope. This method also accepts an array of additional variables to be passed to the template.
setCloner ( AbstractCloner $cloner ) Set the cloner used for dumping variables.
setVariable ( string $variableName, mixd $variableValue ) Sets a single template variable, by its name:
setVariables ( array $variables ) Sets the variables to be passed to all templates rendered by this template helper.
shorten ( string $path ) : string Replace the part of the path that all files have in common.
slug ( string $original ) : string Convert a string to a slug version of itself

Private Methods

Method Description
getDumper ( )

Method Details

breakOnDelimiter() public method

Makes sure that the given string breaks on the delimiter.
public breakOnDelimiter ( string $delimiter, string $s ) : string
$delimiter string
$s string
return string

delVariable() public method

Unsets a single template variable, by its name
public delVariable ( string $variableName )
$variableName string

dump() public method

Format the given value into a human readable string.
public dump ( mixed $value ) : string
$value mixed
return string

dumpArgs() public method

Format the args of the given Frame as a human readable html string
public dumpArgs ( Whoops\Exception\Frame $frame ) : string
$frame Whoops\Exception\Frame
return string the rendered html

escape() public method

Escapes a string for output in an HTML document
public escape ( string $raw ) : string
$raw string
return string

escapeButPreserveUris() public method

Escapes a string for output in an HTML document, but preserves URIs within it, and converts them to clickable anchor elements.
public escapeButPreserveUris ( string $raw ) : string
$raw string
return string

getCloner() public method

Get the cloner used for dumping variables.
public getCloner ( ) : AbstractCloner
return Symfony\Component\VarDumper\Cloner\AbstractCloner

getVariable() public method

Gets a single template variable, by its name, or $defaultValue if the variable does not exist
public getVariable ( string $variableName, mixed $defaultValue = null ) : mixed
$variableName string
$defaultValue mixed
return mixed

getVariables() public method

Returns all variables for this helper
public getVariables ( ) : array
return array

render() public method

Given a template path, render it within its own scope. This method also accepts an array of additional variables to be passed to the template.
public render ( string $template, array $additionalVariables = null )
$template string
$additionalVariables array

setCloner() public method

Set the cloner used for dumping variables.
public setCloner ( AbstractCloner $cloner )
$cloner Symfony\Component\VarDumper\Cloner\AbstractCloner

setVariable() public method

Sets a single template variable, by its name:
public setVariable ( string $variableName, mixd $variableValue )
$variableName string
$variableValue mixd

setVariables() public method

Sets the variables to be passed to all templates rendered by this template helper.
public setVariables ( array $variables )
$variables array

shorten() public method

Replace the part of the path that all files have in common.
public shorten ( string $path ) : string
$path string
return string

slug() public method

Convert a string to a slug version of itself
public slug ( string $original ) : string
$original string
return string