Class yii\debug\Panel

Inheritanceyii\debug\Panel » yii\base\Component
Subclassesyii\debug\panels\AssetPanel, yii\debug\panels\ConfigPanel, yii\debug\panels\DbPanel, yii\debug\panels\EventPanel, yii\debug\panels\LogPanel, yii\debug\panels\MailPanel, yii\debug\panels\ProfilingPanel, yii\debug\panels\RequestPanel, yii\debug\panels\RouterPanel, yii\debug\panels\TimelinePanel, yii\debug\panels\UserPanel
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-debug/blob/master/src/Panel.php

Panel is a base class for debugger panel classes. It defines how data should be collected, what should be displayed at debug toolbar and on debugger details view.

Public Properties

Hide inherited properties

Property Type Description Defined By
$actions array Array of actions to add to the debug modules default controller. yii\debug\Panel
$data mixed Data associated with panel yii\debug\Panel
$detail string Content that is displayed in debugger detail view. yii\debug\Panel
$error yii\debug\FlattenException|null Error while saving the panel yii\debug\Panel
$id string Panel unique identifier. yii\debug\Panel
$module yii\debug\Module yii\debug\Panel
$name string Name of the panel. yii\debug\Panel
$summary string Content that is displayed at debug toolbar. yii\debug\Panel
$tag string Request data set identifier. yii\debug\Panel
$url string URL pointing to panel detail view. yii\debug\Panel

Protected Properties

Hide inherited properties

Property Type Description Defined By

Public Methods

Hide inherited methods

Method Description Defined By
getDetail() yii\debug\Panel
getError() yii\debug\Panel
getName() yii\debug\Panel
getSummary() yii\debug\Panel
getTraceLine() Returns a trace line yii\debug\Panel
getUrl() yii\debug\Panel
hasError() yii\debug\Panel
isEnabled() Checks whether this panel is enabled. yii\debug\Panel
load() Loads data into the panel yii\debug\Panel
save() Saves data to be later used in debugger detail view. yii\debug\Panel
setError() yii\debug\Panel

Property Details

Hide inherited properties

$actions public property

Array of actions to add to the debug modules default controller. This array will be merged with all other panels actions property. See \yii\base\Controller::actions() for the format.

public array $actions = []
$data public property

Data associated with panel

public mixed $data null
$detail public property

Content that is displayed in debugger detail view. This property is read-only.

public string $detail null
$error protected property (available since version 2.0.10)

Error while saving the panel

$id public property

Panel unique identifier. It is set automatically by the container module.

public string $id null
$module public property
public yii\debug\Module $module null
$name public property

Name of the panel. This property is read-only.

public string $name null
$summary public property

Content that is displayed at debug toolbar. This property is read-only.

public string $summary null
$tag public property

Request data set identifier.

public string $tag null
$url public property

URL pointing to panel detail view. This property is read-only.

public string $url null

Method Details

Hide inherited methods

getDetail() public method

public string getDetail ( )
return string

Content that is displayed in debugger detail view

                public function getDetail()
{
    return '';
}

            
getError() public method (available since version 2.0.10)

public yii\debug\FlattenException|null getError ( )

                public function getError()
{
    return $this->error;
}

            
getName() public method

public string getName ( )
return string

Name of the panel

                public function getName()
{
    return '';
}

            
getSummary() public method

public string getSummary ( )
return string

Content that is displayed at debug toolbar

                public function getSummary()
{
    return '';
}

            
getTraceLine() public method (available since version 2.0.7)

Returns a trace line

public string getTraceLine ( $options )
$options array

The array with trace

return string

The trace line

                public function getTraceLine($options)
{
    if (!isset($options['text'])) {
        $options['text'] = "{$options['file']}:{$options['line']}";
    }
    $traceLine = $this->module->traceLine;
    if ($traceLine === false) {
        return $options['text'];
    }
    $options['file'] = str_replace('\\', '/', $options['file']);
    $rawLink = $traceLine instanceof \Closure ? $traceLine($options, $this) : $traceLine;
    return strtr($rawLink, ['{file}' => $options['file'], '{line}' => $options['line'], '{text}' => $options['text']]);
}

            
getUrl() public method

public string getUrl ( $additionalParams null )
$additionalParams null|array

Optional additional parameters to add to the route

return string

URL pointing to panel detail view

                public function getUrl($additionalParams = null)
{
    $route = [
        '/' . $this->module->id . '/default/view',
        'panel' => $this->id,
        'tag' => $this->tag,
    ];
    if (is_array($additionalParams)){
        $route = ArrayHelper::merge($route, $additionalParams);
    }
    return Url::toRoute($route);
}

            
hasError() public method (available since version 2.0.10)

public boolean hasError ( )

                public function hasError()
{
    return $this->error !== null;
}

            
isEnabled() public method (available since version 2.0.10)

Checks whether this panel is enabled.

public boolean isEnabled ( )
return boolean

Whether this panel is enabled.

                public function isEnabled()
{
    return true;
}

            
load() public method

Loads data into the panel

public void load ( $data )
$data mixed

                public function load($data)
{
    $this->data = $data;
}

            
save() public method

Saves data to be later used in debugger detail view.

This method is called on every page where debugger is enabled.

public mixed save ( )
return mixed

Data to be saved

                public function save()
{
    return null;
}

            
setError() public method (available since version 2.0.10)

public void setError ( yii\debug\FlattenException $error )
$error yii\debug\FlattenException

                public function setError(FlattenException $error)
{
    $this->error = $error;
}