示例#1
0
function handle_error_exception($e, $data = [])
{
    //Exception, limited to a 1mb of data
    $data['exception'] = get_class($e) . " ({$e->getCode()}) \"{$e->getMessage()}\"\n" . "<b>on line {$e->getLine()} in {$e->getFile()}</b>\n";
    //Exception, limited to a 1mb of data
    ob_start();
    ini_set('xdebug.var_display_max_depth', 3);
    var_dump($e);
    $dump = ob_get_clean();
    $data['dump'] = substr($dump, 0, 1024 * 1024);
    $data['ex'] = $e;
    // Output
    header("HTTP/1.1 500 Internal Server Error");
    Display::page('standard/error.exception', $data);
    exit;
}
示例#2
0
<?php

use classes\Display;
$data = ['message' => 'Hello world'];
Display::$extra['title'] = 'Hello';
Display::page('home', $data);