how can we view symfony dump() output with ajax request?

江枫思渺然 提交于 2019-12-12 13:10:10

问题


Hi my question is that we can view the output of symfony dump() function with normal http request, but can we view the output with ajax request?


回答1:


Open the developer tools* in your browser before you make the request on your page. Click on the networks tab then perform the action that makes the request. Click on the request (circled in the chrome example below) and select the Preview tab and you'll see all the output.

* Using Chrome open devtools with the keyboard: Ctrl+Shift+i or from the menu > More Tools > Developer Tools

Here's an overview of Chrome's devtools. You can breeze through the videos in < 1hr.

Here's a picture:




回答2:


U can check all dump data from standart symfony profiler toolbar.

First, use dump() function as u usually do:

dump(array('Some key' => 'Some value'));

Then, open app_dev.php symfony enviroment, and do your ajax action. Look at profiler toolbar on request section:

Click on ajax action profile id. (460769 in example above) Then look at debug section in profiler



来源:https://stackoverflow.com/questions/39889082/how-can-we-view-symfony-dump-output-with-ajax-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!