We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Use whoops in phalcon 3

I like this component, but I can not make it work in Phalcon 3. Does anyone has done work?

whoops

https://github.com/filp/whoops https://github.com/whoops-php/phalcon



40.0k
Accepted
answer

composer:

    "filp/whoops": "^2.1",
    "whoops/phalcon": "^2.0"

index.php

    if (ENVIRONMENT == 'development') {
        new Whoops\Provider\Phalcon\WhoopsServiceProvider($di);
    }
edited Sep '18

This indeed works, for those who want it to respond in json, remember to add the next header: X-Requested-With -> XMLHttpRequest. Or you can modify the service provider in order to default to json.