PHP Debug Bar

2020 年 10 月 8 日1420

Install the debug bar using Composer:

{



"require": {



"maximebf/debugbar": "1.*"



}



}
$ php composer.phar install

The DebugBar has two parts: the main DebugBar object with data collectors and the renderer.

Data collectors are objects collecting a specific set of data. To makes things easy,

the StandardDebugBar has all the built-in collectors activated.

<?php



use DebugBar\StandardDebugBar;







$debugbar = new StandardDebugBar();



$debugbarRenderer = $debugbar->getJavascriptRenderer();







$debugbar["messages"]->addMessage("hello world!");



?>



<html>



<head>



<?php echo $debugbarRenderer->renderHead() ?>



</head>



<body>



...



<?php echo $debugbarRenderer->render() ?>



</body>



</html>

Try it below!

0 0