1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-04 08:33:39 +02:00

Merge pull request #13 from thekonz/patch-1

README syntax highlighting
This commit is contained in:
Maxime Bouroumeau-Fuseau
2013-08-28 05:28:17 -07:00

View File

@ -38,11 +38,13 @@ examples and [phpdebugbar.com](http://phpdebugbar.com) for a live example.
The best way to install DebugBar is using [Composer](http://getcomposer.org)
with the following requirement:
```JSON
{
"require": {
"maximebf/debugbar": ">=1.0.0"
}
}
```
If you are cloning the repository, you'll need to run `composer install`.
@ -52,6 +54,7 @@ If you are cloning the repository, you'll need to run `composer install`.
DebugBar is very easy to use and you can add it to any of your projects in no time.
The easiest way is using the `render()` functions
```PHP
<?php
use DebugBar\StandardDebugBar;
use DebugBar\JavascriptRenderer;
@ -69,13 +72,16 @@ The easiest way is using the `render()` functions
...
<?php echo $debugbarRenderer->render() ?>
</body>
</html>
</html>+6
```
The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are
automated but others are manual. Use the `DebugBar` like an array where keys are the
collector names. In our previous example, we add a message to the `MessagesCollector`:
```PHP
$debugbar["messages"]->addMessage("hello world!");
```
`StandardDebugBar` activates the following collectors: