class DebugView

A basic HTML wrapper for stylish rendering of a developement 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

Methods

static Config_ForClass
config()

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

mixed
stat(string $name) deprecated

Get inherited config value

mixed
uninherited(string $name)

Gets the uninherited value for the given config option

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

Update the config value for a given property

static Injectable
create(array $args)

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

static Injectable
singleton(string $class = null)

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

string
Breadcrumbs()

Generate breadcrumb links to the URL path being displayed

writeHeader() deprecated

No description

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

No description

writeFooter() deprecated

No description

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

No description

writeSourceFragment($lines, $errline) deprecated

No description

writeTrace($trace) deprecated

No description

writeVariable($val, $caller) deprecated

No description

string
renderHeader(HTTPRequest $httpRequest = null)

Render HTML header for development views

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

Render the information header for the view

string
renderFooter()

Render HTML footer for development views

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

Render an error.

string
renderSourceFragment(array $lines, int $errline)

Render a fragment of the a source file

string
renderTrace(array $trace)

Render a call track

string
renderParagraph(string $text)

Render an arbitrary paragraph.

string
renderVariable(object $val, array $caller)

Outputs a variable in a user presentable way

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

No description

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

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

string
debugVariableText(mixed $val)

Get debug text for this object

Details

in Configurable at line 20
static Config_ForClass config()

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

....).

Return Value

Config_ForClass

in Configurable at line 32
mixed stat(string $name) deprecated

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

Get inherited config value

Parameters

string $name

Return Value

mixed

in Configurable at line 44
mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

in Configurable at line 57
$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

in Injectable at line 26
static Injectable create(array $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'); $list = SiteTree::get();

Parameters

array $args

Return Value

Injectable

in Injectable at line 43
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

at line 125
string Breadcrumbs()

Generate breadcrumb links to the URL path being displayed

Return Value

string

at line 148
writeHeader() deprecated

deprecated 4.0.0:5.0.0 Use renderHeader() instead

at line 157
writeInfo($title, $subtitle, $description = false) deprecated

deprecated 4.0.0:5.0.0 Use renderInfo() instead

Parameters

$title
$subtitle
$description

at line 166
writeFooter() deprecated

deprecated 4.0.0:5.0.0 Use renderFooter() instead

at line 175
writeError($httpRequest, $errno, $errstr, $errfile, $errline) deprecated

deprecated 4.0.0:5.0.0 Use renderError() instead

Parameters

$httpRequest
$errno
$errstr
$errfile
$errline

at line 184
writeSourceFragment($lines, $errline) deprecated

deprecated 4.0.0:5.0.0 Use renderSourceFragment() instead

Parameters

$lines
$errline

at line 193
writeTrace($trace) deprecated

deprecated 4.0.0:5.0.0 Use renderTrace() instead

Parameters

$trace

at line 202
writeVariable($val, $caller) deprecated

deprecated 4.0.0:5.0.0 Use renderVariable() instead

Parameters

$val
$caller

at line 214
string renderHeader(HTTPRequest $httpRequest = null)

Render HTML header for development views

Parameters

HTTPRequest $httpRequest

Return Value

string

at line 240
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

at line 261
string renderFooter()

Render HTML footer for development views

Return Value

string

at line 276
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 soruce code file where the error occurred
int $errline The line number on which the error occured

Return Value

string

at line 301
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

at line 324
string renderTrace(array $trace)

Render a call track

Parameters

array $trace The debug_backtrace() array

Return Value

string

at line 340
string renderParagraph(string $text)

Render an arbitrary paragraph.

Parameters

string $text The HTML-escaped text to render

Return Value

string

at line 367
string renderVariable(object $val, array $caller)

Outputs a variable in a user presentable way

Parameters

object $val
array $caller Caller information

Return Value

string

at line 381
renderMessage($message, $caller, $showHeader = true)

Parameters

$message
$caller
$showHeader

at line 400
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

at line 421
string debugVariableText(mixed $val)

Get debug text for this object

Parameters

mixed $val

Return Value

string