M
M
Maxim2015-10-06 15:12:18
symfony
Maxim, 2015-10-06 15:12:18

Why aren't ajax requests shown in the symfony 2 profiler?

The beginning of the question
Registered in the config:

web_profiler:
    toolbar:              true
    position:             bottom
    intercept_redirects:  false
    excluded_ajax_paths:  ^/bundles|^/_wdt

didn't help
controller
class DefaultController extends Controller
{
    public function indexAction()
    {
        $request = $this->get('request');
    	return new Response(var_dump($request->isXmlHttpRequest()));
    }
}

js script
$("#ajax").click(function(){
  $.ajax({
     	type: "GET",
     	url: "/app_dev.php/admin",
     	headers: {'X-Requested-With': 'XMLHttpRequest'},
     	success: function(msg){
      	 alert(msg);
     	},
     	error: function(msg){
     		console.log(msg);
     	},
 	});
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Romanenko, 2015-10-06
@maxpointn2point

Nothing extra is needed. The default setting shows everything. Take a screenshot with open the dev tab where the xmlhttp request left and so that the profiler can be seen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question