I am trying to use this
https://github.com/barelon/CgKintBundle https://github.com/raveren/kint
for debugging
Now i am able to see debugging in TWIG templates but i am 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);
do i need to add this code in controller of symfony
Kint already comes with a autoload
section in it's composer.json and the Kint class itself doesn't have a namespace.
composer
will take care of the autoloading for you which means the require
statement isn't necessary.
You can use this "debugging tool" in any class (controller,entity, ...) like this:
\Kint::dump($someVariable);
It's just a prettyfied version of var_dump()
.
I suggest you take a look at raulfraile/LadyBugBundle which uses ladybug instead of Kint
... but can highlight symfony/doctrine classes with funky symbols aswell.
If you want real debugging capabilities ... install xdebug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With