Skip to content

Commit 56547ac

Browse files
committed
Use layout
1 parent 83fab70 commit 56547ac

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/Controller/DebugKitController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Cake\Database\Driver\Sqlite;
1818
use Cake\Datasource\ConnectionManager;
1919
use Cake\Event\Event;
20-
use Cake\Network\Exception\NotFoundException;
20+
use Cake\Http\Exception\NotFoundException;
2121

2222
/**
2323
* Dashboard and common DebugKit backend.
@@ -29,14 +29,16 @@ class DebugKitController extends Controller
2929
*
3030
* @param \Cake\Event\Event $event The event.
3131
* @return void
32-
* @throws \Cake\Network\Exception\NotFoundException
32+
* @throws \Cake\Http\Exception\NotFoundException
3333
*/
3434
public function beforeFilter(Event $event)
3535
{
3636
// TODO add config override.
3737
if (!Configure::read('debug')) {
38-
throw new NotFoundException();
38+
throw new NotFoundException('Not available without debug mode on.');
3939
}
40+
41+
$this->viewBuilder()->setLayout('dashboard');
4042
}
4143

4244
/**

src/Template/Layout/dashboard.ctp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php $this->extend('toolbar') ?>
2+
3+
<div style="height:calc(100vh);overflow-y:scroll">
4+
<?php if (empty($noHeader)) : ?>
5+
<h2 class="panel-title">
6+
<?= isset($title) ? h($title) : __d('debug_kit', 'DebugKit Dashboard') ?>
7+
</h2>
8+
<?php endif ?>
9+
10+
<div class="panel-content">
11+
<?= $this->fetch('content'); ?>
12+
</div>
13+
</div>

0 commit comments

Comments
 (0)