Skip to content

Instantly share code, notes, and snippets.

@rotexdegba
Last active January 27, 2021 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rotexdegba/3df77f60e334f6876deec3f198012fd2 to your computer and use it in GitHub Desktop.
Save rotexdegba/3df77f60e334f6876deec3f198012fd2 to your computer and use it in GitHub Desktop.

Make sure you have installed debugbar via composer.

Copy this script to the root folder of you application and run it from there.

In your template file, which will usually be located in ./src/layout-templates, add the code below inside the head section of the template:

  <link rel="stylesheet" type="text/css" href="<?= s3MVC_MakeLink('/css/debugbar-css-assets.css'); ?>">
  <script type="text/javascript" src="<?= s3MVC_MakeLink('/js/debugbar-js-assets.js'); ?>"></script>

  <!-- include the line below if you are using JQuery -->
  <script type="text/javascript">jQuery.noConflict(true);</script>

In the body section of your your template file add the code below to a suitable part where you want the debugbar panel to be displayed:

  <?php echo $debugbar->getJavascriptRenderer()->render(); ?>

It is assumed that $debugbar is an instance of DebugBar\StandardDebugBar you have configured and is available to your template file.

You are done at this point, debugbar should be visible on the pages of your website now. Obviously it expected that you would have added messages to $debugbar before it is rendered in the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment