Commit 4d616298 by Tobias Munk

added check for db and request panel, disabled output if one is missing

parent 87cb3e5b
......@@ -31,13 +31,14 @@ $this->title = 'Yii Debugger';
<div class="container">
<div class="row">
<h1>Available Debug Data</h1>
<?php
$timeFormatter = extension_loaded('intl') ? Yii::createObject(['class' => 'yii\i18n\Formatter']) : Yii::$app->formatter;
if (isset($this->context->module->panels['db']) && isset($this->context->module->panels['request'])) {
echo " <h1>Available Debug Data</h1>";
$timeFormatter = extension_loaded('intl') ? Yii::createObject(['class' => 'yii\i18n\Formatter']) : Yii::$app->formatter;
echo GridView::widget([
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function ($model, $key, $index, $grid) use ($searchModel) {
......@@ -105,7 +106,13 @@ echo GridView::widget([
'label' => 'Status code'
],
],
]); ?>
]);
} else {
echo "<div class='alert alert-warning'>No data available. Panel <code>db</code> or <code>request</code> not found.</div>";
}
?>
</div>
</div>
</div>
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