PHP code example of zeuxisoo / slim-whoops

1. Go to this page and download the library: Download zeuxisoo/slim-whoops library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zeuxisoo / slim-whoops example snippets


$app->add(new Zeuxisoo\Whoops\Slim\WhoopsMiddleware());

$app->add(new Zeuxisoo\Whoops\Slim\WhoopsMiddleware([
    'enable' => true,
    'editor' => 'sublime',
    'title'  => 'Custom whoops page title',
]));

$app->add(new Zeuxisoo\Whoops\Slim\WhoopsMiddleware([
    'editor' => function($file, $line) {
        return "http://localhost:8091?message=%file:%line";
    }
]));

$simplyErrorHandler = function($exception, $inspector, $run) {
    $message = $exception->getMessage();
    $title   = $inspector->getExceptionName();

    echo "{$title} -> {$message}";
    exit;
};

new Zeuxisoo\Whoops\Slim\WhoopsMiddleware([], [$simplyErrorHandler]);