aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/debugbar.php
blob: 59627f27964daf56260823ff12b9f1c63d9161bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
final class DebugbarController extends Trails_Controller
{
    public function __construct(
        Trails\Dispatcher $dispatcher,
        private readonly DebugBar\DebugBar $debugbar
    ) {
        parent::__construct($dispatcher);
    }

    public function css_action(): void
    {
        $this->set_content_type('text/css;charset=utf-8');
        $this->render_nothing();
        $this->debugbar->getJavascriptRenderer()->dumpCssAssets();
    }

    public function js_action(): void
    {
        $this->set_content_type('text/javascript;charset=utf-8');
        $this->render_nothing();
        $this->debugbar->getJavascriptRenderer()->setIncludeVendors(false)->dumpJsAssets();
    }
}