class DebugView (View source)

A basic HTML wrapper for stylish rendering of a development info view.

Used to output error messages, and test results.

Traits

Provides extensions to this object to integrate it with standard config API methods.

A class that can be instantiated or replaced via DI

Config options

columns int

Column size to wrap long strings to

Properties

protected static $error_types
protected static $unknown_error

Methods

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
stat(string $name) deprecated

Get inherited config value

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

public static 
create(mixed ...$args)

An implementation of the factory method, allows you to create an instance of a class

public static 
singleton(string $class = null)

Creates a class instance by the "singleton" design pattern.

public
string
Breadcrumbs()

Generate breadcrumb links to the URL path being displayed

public
writeHeader() deprecated

No description

public
writeInfo($title, $subtitle, $description = false) deprecated

No description

public
writeFooter() deprecated

No description

public
writeError($httpRequest, $errno, $errstr, $errfile, $errline) deprecated

No description

public
writeSourceFragment($lines, $errline) deprecated

No description

public
writeTrace($trace) deprecated

No description

public
writeVariable($val, $caller) deprecated

No description

public
string
renderHeader(HTTPRequest $httpRequest = null)

Render HTML header for development views

public
string
renderInfo(string $title, string $subtitle, string|bool $description = false)

Render the information header for the view

public
string
renderFooter()

Render HTML footer for development views

public
string
renderError(string $httpRequest, int $errno, string $errstr, string $errfile, int $errline)

Render an error.

public
string
renderSourceFragment(array $lines, int $errline)

Render a fragment of the a source file

public
string
renderTrace(array $trace)

Render a call track

public
string
renderParagraph(string $text)

Render an arbitrary paragraph.

protected
string
formatCaller(array $caller)

Formats the caller of a method

public
string
renderVariable(object $val, array $caller)

Outputs a variable in a user presentable way

public
renderMessage($message, $caller, $showHeader = true)

No description

public
string
debugVariable(mixed $val, array $caller, bool $showHeader = true)

Similar to renderVariable() but respects debug() method on object if available

public
string
debugVariableText(mixed $val)

Get debug text for this object

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

static Injectable create(mixed ...$args)

An implementation of the factory method, allows you to create an instance of a class

This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.

This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create(SiteTree::class); $list = SiteTree::get();

Parameters

mixed ...$args

Return Value

Injectable

static Injectable singleton(string $class = null)

Creates a class instance by the "singleton" design pattern.

It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).

Parameters

string $class

Optional classname to create, if the called class should not be used

Return Value

Injectable

The singleton instance

string Breadcrumbs()

Generate breadcrumb links to the URL path being displayed

Return Value

string

writeHeader() deprecated

deprecated 4.0.1 Use renderHeader() instead

No description

writeInfo($title, $subtitle, $description = false) deprecated

deprecated 4.0.1 Use renderInfo() instead

No description

Parameters

$title
$subtitle
$description

writeFooter() deprecated

deprecated 4.0.1 Use renderFooter() instead

No description

writeError($httpRequest, $errno, $errstr, $errfile, $errline) deprecated

deprecated 4.0.1 Use renderError() instead

No description

Parameters

$httpRequest
$errno
$errstr
$errfile
$errline

writeSourceFragment($lines, $errline) deprecated

deprecated 4.0.1 Use renderSourceFragment() instead

No description

Parameters

$lines
$errline

writeTrace($trace) deprecated

deprecated 4.0.1 Use renderTrace() instead

No description

Parameters

$trace

writeVariable($val, $caller) deprecated

deprecated 4.0.1 Use renderVariable() instead

No description

Parameters

$val
$caller

string renderHeader(HTTPRequest $httpRequest = null)

Render HTML header for development views

Parameters

HTTPRequest $httpRequest

Return Value

string

string renderInfo(string $title, string $subtitle, string|bool $description = false)

Render the information header for the view

Parameters

string $title

The main title

string $subtitle

The subtitle

string|bool $description

The description to show

Return Value

string

string renderFooter()

Render HTML footer for development views

Return Value

string

string renderError(string $httpRequest, int $errno, string $errstr, string $errfile, int $errline)

Render an error.

Parameters

string $httpRequest

the kind of request

int $errno

Codenumber of the error

string $errstr

The error message

string $errfile

The name of the source code file where the error occurred

int $errline

The line number on which the error occurred

Return Value

string

string renderSourceFragment(array $lines, int $errline)

Render a fragment of the a source file

Parameters

array $lines

An array of file lines; the keys should be the original line numbers

int $errline

The line of the error

Return Value

string

string renderTrace(array $trace)

Render a call track

Parameters

array $trace

The debug_backtrace() array

Return Value

string

string renderParagraph(string $text)

Render an arbitrary paragraph.

Parameters

string $text

The HTML-escaped text to render

Return Value

string

protected string formatCaller(array $caller)

Formats the caller of a method

Parameters

array $caller

Return Value

string

string renderVariable(object $val, array $caller)

Outputs a variable in a user presentable way

Parameters

object $val
array $caller

Caller information

Return Value

string

renderMessage($message, $caller, $showHeader = true)

No description

Parameters

$message
$caller
$showHeader

string debugVariable(mixed $val, array $caller, bool $showHeader = true)

Similar to renderVariable() but respects debug() method on object if available

Parameters

mixed $val
array $caller
bool $showHeader

Return Value

string

string debugVariableText(mixed $val)

Get debug text for this object

Parameters

mixed $val

Return Value

string