Something like laravel "dd" function |
I miss something like "dd" function in laravel to print the object's tree and vars.
What is wrong with print_r and var_dump ?
http://php.net/manual/en/function.print-r.php http://php.net/manual/en/function.var-dump.php If it is the formatting on screen output try viewing the page source, much cleaner.
I'm sorry, but print_r and var_dump are very simples, in large objects are very tedious debug. Please see that link http://laraveldaily.com/echoing-dd-vs-va...s-print_r/
I'm codeigniter fanatic but we should recognize the good work in another frameworks. Regards.
That post seems to be saying that dd is a PITA.
I admit that when debugging very large arrays it is a pain to decipher the content sometimes. But I just do not understand the need for dd at all. I suppose it might be handy in some contexts. It reminds me of exploring objects in a browser console, which I always find a pain. Probably because I do not do it enough. There is no equivalent of DD in CI. Perhaps you could write one. It does not seem to be a particularly complex function, although I bet it gets complicated when you start taking into account edge cases. Personally, if you are analysing an array of substantial size to debug something, I would always break code down into smaller chunks which are more manageable. Quote:we should recognize the good work in another frameworks. I totally agree with you on this. But I am still failing to see the benefit of dd https://laracasts.com/discuss/channels/g...-of-shitty
If you need something anyway, you may try https://github.com/CesiumComputer/print_d
Or the old CI Favorite as a helper method:
PHP Code: /** What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
If you like the output like dd, you can use http://symfony.com/doc/current/component...umper.html with Composer.
I use FirePHP. Gives me all the debugging data I need, and doesn't stop execution like dd does.
|
Welcome Guest, Not a member yet? Register Sign In |