NoahBuscher\Macaw\Macaw::error PHP Method

error() public static method

Defines callback if route is not found
public static error ( $callback )
    public static function error($callback)
    {
        self::$error_callback = $callback;
    }

Usage Example

Beispiel #1
0
<?php

use NoahBuscher\Macaw\Macaw;
Macaw::get('/', function () {
    echo 'Hello world!';
});
Macaw::post('/', function () {
    echo 'I <3 POST commands!';
});
Macaw::error(function () {
    echo '404 :: Not Found';
});
Macaw::get('/test', 'TestController@index');
Macaw::dispatch();
All Usage Examples Of NoahBuscher\Macaw\Macaw::error