5

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

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

6 Comments

thanks ladybug was execellent, i installed xdebug as mentioned but could not find how to use it
I tried using ladybug , so far i am only able to use labybug_dump which works ok , all other functions like ladybug_dump_return are not working. its says function not found in namespace
Please open another question for your current issue. I will try to help if i can. :)
I used ladybug but Kint is just .... better : variable name, no nested limitations, timestamp displayed as a date/time ...
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.