Pretty dump variable / object in Symfony 2. *?

When developing the material, I need to deduce the state of some instance in order to check it.

When using CakePHP, I always had a debug () function that executes some kind of var_dump inside the <pre> html, so the content is readable.

Something similar in symfony 2.x too?

+5
source share
4 answers
exit(\Doctrine\Common\Util\Debug::dump($someVar));
+16
source

using

\ Doctrine \ Common \ Util \ Debug :: dump ($ to user);

+8
source

Today, one of the best debugging methods in Symfony that I know of is Ladybug Bundle . Its output is similar to xdebug, but it has some nice features, such as a prefabricated tree structure for arays or automatic linking to documentation pages (supporting standard PHP, Doctrine and Symfony).

In README, you can find some great examples of its use.

+5
source

Now in Symfony - dump () a new function has appeared, see http://symfony.com/blog/new-in-symfony-2-6-vardumper-component

+1
source

All Articles