问题
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