How to use Kint Debugger in a Symfony controller

I'm trying to use this

https://github.com/barelon/CgKintBundle https://github.com/raveren/kint

for debugging

Now I can see debugs in TWIG templates, but I'm not sure how to use

https://github.com/raveren/kint#installation-and-usage

in symfony php clases.

require '/kint/Kint.class.php';

########## DUMP VARIABLE ###########################
Kint::dump($GLOBALS, $_SERVER); // any number of parameters
// or simply use d() as a shorthand:
d($_SERVER);

I need to add this code to a symfony controller

+3
source share
1 answer

Kint already has a section autoloadin it composer.json and the Kint class does not have a namespace.

composerwill take care of autoload for you, which means that the operator is requirenot needed.

"" (, ,...) :

\Kint::dump($someVariable);

var_dump().

raulfraile/LadyBugBundle, ladybug Kint ... symfony/doctrine .

... install xdebug.

+4

All Articles