PHP code example of tourze / symfony-profiler-markdown-bundle

1. Go to this page and download the library: Download tourze/symfony-profiler-markdown-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tourze / symfony-profiler-markdown-bundle example snippets


// config/bundles.php
return [
    // ...
    Tourze\ProfilerMarkdownBundle\ProfilerMarkdownBundle::class => ['all' => true],
];



use Tourze\ProfilerMarkdownBundle\Formatter\MarkdownFormatterInterface;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;

class CustomFormatter implements MarkdownFormatterInterface
{
    public function supports(DataCollectorInterface $collector): bool
    {
        return $collector instanceof YourCustomCollector;
    }

    public function format(DataCollectorInterface $collector): array
    {
        // Return array of Markdown lines
        return [
            "## Custom Data",
            "",
            "| Property | Value |",
            "|----------|-------|",
            "| Custom Field | Custom Value |",
            "",
        ];
    }

    public function getPriority(): int
    {
        return 0; // Higher priority = earlier execution
    }
}