fabfuel / prophiler

PHP Profiler & Developer Toolbar (built for Phalcon)
http://prophiler.fabfuel.de
Other
443 stars 54 forks source link

Don't add output to all my pages [fixed] #13

Closed ivancduran closed 9 years ago

ivancduran commented 9 years ago

I have a html request and API (JSON) request in the same application, the main problem is the project add a output string to all my request, including JSON.

The solution for this inconvenience is disable Views in que API controller in initialize and check on the main page (index.php) if the View is disabled.

Simple App template "Index.php":

$toolbar = new \Fabfuel\Prophiler\Toolbar($profiler); $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());

if(!$di['view']->isDisabled()){ echo $toolbar->render(); }

I hope this can help more people with the same problem

fabfuel commented 9 years ago

That's a good hint, Thanks!