mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-19 07:41:39 +02:00
README syntax highlighting
use syntax highlighting, would you?
This commit is contained in:
48
README.md
48
README.md
@@ -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)
|
The best way to install DebugBar is using [Composer](http://getcomposer.org)
|
||||||
with the following requirement:
|
with the following requirement:
|
||||||
|
|
||||||
{
|
```JSON
|
||||||
"require": {
|
{
|
||||||
"maximebf/debugbar": ">=1.0.0"
|
"require": {
|
||||||
}
|
"maximebf/debugbar": ">=1.0.0"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
If you are cloning the repository, you'll need to run `composer install`.
|
If you are cloning the repository, you'll need to run `composer install`.
|
||||||
|
|
||||||
@@ -52,30 +54,34 @@ 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.
|
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
|
The easiest way is using the `render()` functions
|
||||||
|
|
||||||
<?php
|
```PHP
|
||||||
use DebugBar\StandardDebugBar;
|
<?php
|
||||||
use DebugBar\JavascriptRenderer;
|
use DebugBar\StandardDebugBar;
|
||||||
|
use DebugBar\JavascriptRenderer;
|
||||||
|
|
||||||
$debugbar = new StandardDebugBar();
|
$debugbar = new StandardDebugBar();
|
||||||
$debugbarRenderer = $debugbar->getJavascriptRenderer();
|
$debugbarRenderer = $debugbar->getJavascriptRenderer();
|
||||||
|
|
||||||
$debugbar["messages"]->addMessage("hello world!");
|
$debugbar["messages"]->addMessage("hello world!");
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<?php echo $debugbarRenderer->renderHead() ?>
|
<?php echo $debugbarRenderer->renderHead() ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
...
|
...
|
||||||
<?php echo $debugbarRenderer->render() ?>
|
<?php echo $debugbarRenderer->render() ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>+6
|
||||||
|
```
|
||||||
|
|
||||||
The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are
|
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
|
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`:
|
collector names. In our previous example, we add a message to the `MessagesCollector`:
|
||||||
|
|
||||||
$debugbar["messages"]->addMessage("hello world!");
|
```PHP
|
||||||
|
$debugbar["messages"]->addMessage("hello world!");
|
||||||
|
```
|
||||||
|
|
||||||
`StandardDebugBar` activates the following collectors:
|
`StandardDebugBar` activates the following collectors:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user