Commit beafb99e by Qiang Xue

Added support to disable a debug panel.

parent 81f36ec2
...@@ -38,7 +38,9 @@ class Module extends \yii\base\Module ...@@ -38,7 +38,9 @@ class Module extends \yii\base\Module
*/ */
public $logTarget; 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 = []; public $panels = [];
/** /**
...@@ -64,7 +66,7 @@ class Module extends \yii\base\Module ...@@ -64,7 +66,7 @@ class Module extends \yii\base\Module
Yii::$app->getView()->on(View::EVENT_END_BODY, [$this, 'renderToolbar']); 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) { foreach ($this->panels as $id => $config) {
$config['module'] = $this; $config['module'] = $this;
$config['id'] = $id; $config['id'] = $id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment