Skip to content

Commit

Permalink
Added support to disable a debug panel.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue committed Feb 7, 2014
1 parent 81f36ec commit beafb99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/debug/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class Module extends \yii\base\Module
*/
public $logTarget;
/**
* @var array|Panel[]
* @var array list of debug panels. The array keys are the panel IDs, and values are the corresponding
* panel class names or configuration arrays. This will be merged with [[corePanels()]].
* You may set a panel to be false to disable a core panel.
*/
public $panels = [];
/**
Expand All @@ -64,7 +66,7 @@ public function init()
Yii::$app->getView()->on(View::EVENT_END_BODY, [$this, 'renderToolbar']);
});

$this->panels = ArrayHelper::merge($this->corePanels(), $this->panels);
$this->panels = array_filter(ArrayHelper::merge($this->corePanels(), $this->panels));
foreach ($this->panels as $id => $config) {
$config['module'] = $this;
$config['id'] = $id;
Expand Down

0 comments on commit beafb99

Please sign in to comment.