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());
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