Debug

You can enable debugging during application instantiation with this setting:

  1. <?php
  2. $app = new \Slim\Slim(array(
  3. 'debug' => true
  4. ));

You may also enable debugging during runtime with the Slim application’s config() instance method:

  1. <?php
  2. $app = new \Slim\Slim();
  3. //Enable debugging (on by default)
  4. $app->config('debug', true);
  5. //Disable debugging
  6. $app->config('debug', false);

If debugging is enabled and an exception or error occurs, a diagnostic screen will appear with the error description,the affected file, the file line number, and a stack trace. If debugging is disabled, the custom Error handler willbe invoked instead.