Web Profiler not showing up in dev

后端 未结 5 1022
旧巷少年郎
旧巷少年郎 2020-12-16 17:36

Im using Symfony2 (const version=\"2.5.10\") and using xampp with PHP version 5.5.19.

I got a problem that in my dev environment the profiler didn\'t show up.What co

5条回答
  •  爱一瞬间的悲伤
    2020-12-16 18:07

    In case your action not returning html code (e.g json API) and you want to use profiler:

    Quick and dirty solution:

    return new Response("Debug data");
    

    Even quicker and dirtier solution - returning non Response type in controller will raise exception with profiler enabled response:

    return 1;
    

    If your application is running by Symfony >=2.4 you can also use X-Debug-Token which contains debug token and X-Debug-Token-Link header which contains link to profiler page. If you want to use this method Chrome extension Symfony2 Profiler shortcut will increase your user experience.

提交回复
热议问题