1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\debug;
use Yii;
use yii\base\Component;
/**
* Panel is a base class for debugger panel. It defines how data should be collected,
* what should be dispalyed at debug toolbar and on debugger details view.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class Panel extends Component
{
public $id;
public $tag;
/**
* @var Module
*/
public $module;
public $data;
/**
* @return string name of the panel
*/
public function getName()
{
return '';
}
/**
* @return string content that is displayed at debug toolbar
*/
public function getSummary()
{
return '';
}
/**
* @return string content that is displayed in debugger detail view
*/
public function getDetail()
{
return '';
}
/**
* Saves data to be later used in debugger detail view.
* This method is called on every page where debugger is enabled.
*
* @return mixed data to be saved
*/
public function save()
{
return null;
}
public function load($data)
{
$this->data = $data;
}
/**
* @return string URL pointing to panel detail view
*/
public function getUrl()
{
return Yii::$app->getUrlManager()->createUrl($this->module->id . '/default/view', array(
'panel' => $this->id,
'tag' => $this->tag,
));
}
}