0

Good day all, often when I'm developing, I get a crash, with a message like this:

Method "id" for object "Symfony\Component\Form\FormView" does not exist ...

This is the perfect time to be able to dump the object, but I don't see how to do that. Is there an easy way?

Ideally, VarDump would be available right in the debut/profile bar.

Maybe I'm not looking in the right place?

Sure, I could go back and add a call to my code just before where it crashes, but that's slow and labour intensive.

Is there any way to easily extend the debug/profile toolbar, so that it offers this option, as a collapsable element, for the object that caused the crash?

This really seems like it would save lots of time debugging.

Here's hoping!

Ed Love
  • 43
  • 6
  • Take a look to the stack trace showed on the 500 page. From there you should notice what form is causing that error. Of course no, there's no way to dump the object and I suppose it could be difficult to implement too. – DonCallisto Jan 06 '16 at 08:57
  • You cannot see the content of your variable in the debug toolbar but you can use a specific `\Doctrine\Common\Util\Debug::dump($yourVariable);` to show the content of your variable instead of the single `var_dump` php function (or `print_r`), have a look to this post: http://stackoverflow.com/questions/11902099/too-much-data-with-var-dump-in-symfony2-doctrine2 – Sylvain Martin Jan 06 '16 at 09:05
  • @SylvainMARTIN or event the Symfony VarDumper component, but that's not OP question – DonCallisto Jan 06 '16 at 09:29
  • Do other more experienced Symfony users think this dump option might be helpful? If so, might it be worth mentioning to the Symfony team? – Ed Love Jan 17 '16 at 06:53

0 Answers0