Beispiel #1
0
<?php

use TinyLara\TinyRouter\TinyRouter as Route;
Route::get('/', 'HomeController@home');
Route::any('foo', function () {
    echo "Foo!";
});
Route::filter(function () {
    return isset($_GET['token']) && $_GET['token'] == 1;
}, function () {
    Route::any('bar', function () {
        echo "Bar!<br>Filter Success!";
    });
});
Route::dispatch('View@process');
Beispiel #2
0
<?php

use TinyLara\TinyRouter\TinyRouter as Route;
Route::get('/', 'HomeController@home');
Route::get('login', 'AuthController@login');
Route::post('api/1/login', 'AuthController@APILogin');
Route::post('storage', 'HomeController@storage');
Route::error(function () {
    throw new Exception("404 Not Found");
});
Route::dispatch('View@process');