Moved to here
Make CodeIgniter 4 Database Debug Toolbar SQL Syntax to be more readable and themeable.
Install library via composer:
composer require nfaiz/ci4-debug-toolbar
Or refer here for manual installation.
Library setup can be done via spark:
php spark debugtoolbar:database
This command will try to overwrite some content in app/Config/Events.php and app/Config/Toolbar.php.
Choose overwrite [y
] when prompted.
Or refer here for manual setup.
After library installation and setup are completed, refresh page to see result.
See usage to configure with other pre-installed stylesheet themes.
Open app/Config/Toolbar.php.
Find $sqlCssTheme
property.
public $sqlCssTheme = [
'light' => 'github',
'dark' => 'dracula'
];
light
anddark
are mode options for CodeIghniter 4 debug toolbar.- Assign stylesheet name without
.css
extension. E.g'github'
- Available stylesheets can be found using utilities
Use HighlightUtilities function from Highlight.php.
Please see highlighter-utilities for more information.
E.g In Controller
// Get available stylesheets.
$list = \HighlightUtilities\getAvailableStyleSheets();
d($list);
// Set true to get available stylesheets with absolute path.
$listPath = \HighlightUtilities\getAvailableStyleSheets(true);
d($listPath);
// Get specific stylesheet path.
$path = \HighlightUtilities\getStyleSheetPath('github');
d($path);
- Light
- Dark
- Light (using default.css)
- Dark (using dark.css)
- Light (using atom-one-light.css)
- Dark (using atom-one-dark.css)
- Highlight.php
- Inspired by this pull request