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

Properties

static private int $columns

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

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(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::class); $list = SiteTree::get();

Parameters

array ...$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.0:5.0.0 Use renderHeader() instead

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

deprecated 4.0.0:5.0.0 Use renderInfo() instead

Parameters

$title
$subtitle
$description

writeFooter() deprecated

deprecated 4.0.0:5.0.0 Use renderFooter() instead

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

deprecated 4.0.0:5.0.0 Use renderError() instead

Parameters

$httpRequest
$errno
$errstr
$errfile
$errline

writeSourceFragment($lines, $errline) deprecated

deprecated 4.0.0:5.0.0 Use renderSourceFragment() instead

Parameters

$lines
$errline

writeTrace($trace) deprecated

deprecated 4.0.0:5.0.0 Use renderTrace() instead

Parameters

$trace

writeVariable($val, $caller) deprecated

deprecated 4.0.0:5.0.0 Use renderVariable() instead

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

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)

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